Reputation: 3
All ,
How can I apply level (10, 245, 095) to a picture. When these level are applied in photoshop the results are different, when I am doing same in Imagemagick I get a completely different result. What am I missing
Upvotes: 0
Views: 125
Reputation: 8153
This question was also asked on the ImageMagick forum and answered by Fred (http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=26023). This is his answer:
IM -level values for min and max, depend upon the Q level of your IM compile. check convert -version. I assume it will say Q16, which means that IM is expecting values in the range of 0 to 65535. So you need to convert your values of 0 to 255 to the range of 65535 or what I usually do is convert the values to percent and use that:
10/255 = 0.03921568627451 (x100 to get percent)
245/255 = 0.96078431372549 (x100 to get percent)
so try
-level 3.921%,96.08%,0.95
The gamma value (0.95) does not need any conversion.
See: http://www.imagemagick.org/script/command-line-options.php#level
Upvotes: 2