Duplicate Photoshop Level

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
JagVoylla
Posts: 17
Joined: 2014-08-01T11:34:57-07:00
Authentication code: 6789

Duplicate Photoshop Level

Post by JagVoylla »

All,

I am new to Imagemagick and want to duplicate photoshop like levels (10, 245, 0.95) on my Image. I am seeing a complete washout of the image, what am I missing?
convert IMTEST.jpg -level 10,245,0.95 IM.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Duplicate Photoshop Level

Post by fmw42 »

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/comma ... .php#level

For new users of IM, see

http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/

To duplicate PS levels output values, follow the above command with +level outputmin,outputmax

Code: Select all

-level inputmin,inputmax,gamma +level outputmin,outputmax
JagVoylla
Posts: 17
Joined: 2014-08-01T11:34:57-07:00
Authentication code: 6789

Re: Duplicate Photoshop Level

Post by JagVoylla »

That works , Thank you so much for all the links as well!
Post Reply