Problem with level correction

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
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Problem with level correction

Post by Elapido »

Hi. I'm using mogrify -auto-level to make corrections to a series of images, something that I normaly do manually with Photoshop. I use levels adjust to move the selectors of the histogram to coincide with the beginning and end of the graph so that the darker tone is black or almost black and the brightest is white or almost white. I've tried this with Acdsee and the result is perfect. However, I don't know what's wrong or what I am not doing right but the results with autolevels in Imagemagick are not what I expect. Any way to control the autolevel correction? Any other command for this? I've made a collage image depicting the results. You can see there the original image, to which I deliberately alter levels to show the problem of an image with incorrect bright levels (what is white appears as bright grey), and an image with wrong dark levels (very common problem in the images I have to modify: black is not black so the image lack contrast and beauty). As you can see, the result of the corrections with Acdsee are almost exact to the original image, meaning that the job is well done. With Autohotkey, the correction is partial, especially with dark areas. Notice how the histogram still has some blank space on the left until the graphic begins.

Click to see the results of levels correction:
http://www.alvarezeninternet.com/temp/levels.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with level correction

Post by fmw42 »

-auto-level with stretch the histogram to full dynamic range, but will not go past that, ie. it won't clip the ends of the histogram

so try -contrast-stretch

see http://www.imagemagick.org/script/comma ... st-stretch

you can specify the % you want to clip from each side of the histogram
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Re: Problem with level correction

Post by Elapido »

Excellent. I'll try and see. Thanx! ;)
Post Reply