Page 1 of 1

JMagick: levels not working properly

Posted: 2016-08-19T08:58:37-07:00
by amit1411

I am working on an Android app, where I need to apply levels to an image via JMagick. JMagick API levelImage takes one string as an argument. Since we need to provide black point, midpoint and white point, could someone please help on how it needs to be provided?

I tried some options with comma separated values like "0%,15%,1", "0,217,1" but did not get expected results.

Thanks for the help.

Re: JMagick: levels not working properly

Posted: 2016-08-19T09:48:13-07:00
by fmw42
I do not know about JMagick, but only one set of triplets can be used, such as 0%,95%,1 which would not change black, reduce white to gray(95%) and not change the midvalue (gamma), since its value is 1. The percents are not clip percents in counts but percentage graylevels where 0% is black and 100% is white. See ... .php#level

Re: JMagick: levels not working properly

Posted: 2016-08-19T10:23:35-07:00
by fmw42
According to, the order appears to be black, mid, and white.

So just a guess; "0% 1 85%" or perhaps it only works with quantumrange values. So if your Qlevel is Q16, then the range is 0 to 65535. So 8% of 65535 would be 55705, so "0 1 55705". Not sure if you need comma separators or not, since I do not use Jmagick

Re: JMagick: levels not working properly

Posted: 2016-08-19T14:10:11-07:00
by fmw42
P.S. I do not believe JMagick is a product developed or maintained by Imagemagick. So you may be better to ask your question on JMagick forum or to the JMagick web site (listed) in my previous email. Perhaps someone who knows coding can decipher the code for how the arguments need to be expressed.