Mogrify -normalize oversaturates images

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

Mogrify -normalize oversaturates images

Post by Elapido »

I'm using this command for autocorrection of levels in photos. The problem is that, in many cases, the colors get oversaturated. For instance, the color of the bodies turns like red. Is there a way to prevent this? Could it be that -normalize corrects levels with too much strenght? Maybe this is not the right command for what I need? Is there a way to control it?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify -normalize oversaturates images

Post by fmw42 »

try -auto-level (or on older systems -contrast-stretch 0)

-normalize will clip at the ends, thus saturating pixels on either end. -auto-level stretches just to the full dynamic range

see
http://www.imagemagick.org/script/comma ... #normalize
http://www.imagemagick.org/script/comma ... auto-level
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Mogrify -normalize oversaturates images

Post by snibgo »

In my experience, in ordinary photographs, any spreading out of pixel values by "-auto-level", "-normalize", "-contrast-stretch", "-equalize" etc will increase saturation. (It is almost inevitable.) So it should come early in the workflow, before decisions about saturation. To decrease saturation, "-modulate 100,80,100" or similar is useful.
snibgo's IM pages: im.snibgo.com
Elapido
Posts: 42
Joined: 2011-06-10T14:27:28-07:00
Authentication code: 8675308

Re: Mogrify -normalize oversaturates images

Post by Elapido »

I've tried with auto-level but the correction of the images is too subtle, almost unnoticiable. I'm using Photoshop to manually correct oversaturated photos. What does that "-modulate 100,80,100" command do? Does it magically correct oversaturated images or does it affect all images?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Mogrify -normalize oversaturates images

Post by snibgo »

See http://www.imagemagick.org/script/comma ... p#modulate

Instead of "80", use "100" for no change, "0" to entirely remove saturation, "120" to increase it, etc. It has no concept of "oversaturated". That's a decision you must make. You might automate it in a script, getting a numeric value for the current saturation. See my page "Adding zing to photographs" including the script "stats.bat".
snibgo's IM pages: im.snibgo.com
Post Reply