ImageMagick supports the same function using the
Code: Select all
-level
According to the docs, one can specify
Code: Select all
-level black_point,white_point
The range for these parameters is 0 to QuantumRange, or from 0 to 100%. "QuantumRange" being the maximum possible value according to pixel depth. For 8bit/channel RGB images (the usual), it would be 255.0.
It also says:
Now here is my problem:If a % sign is present anywhere in the string, both black and white points are percentages of the full color range.
This works fine, when using percentages:
Code: Select all
convert SOME_IMAGE -level 10%,90% OUTPUT_IMAGE
Code: Select all
convert SOME_IMAGE -level 92,243 OUTPUT_IMAGE
I've also looked here but all examples are using percentages.
How can I apply a "Levels" with ImageMagick, preferably without resorting to bc to perform floating point percentage calculations from my actual numerical values?
Thank you.
Tested with
Version: ImageMagick 6.8.6-10 2016-05-30 Q16