Trying to understand -normalize

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
Scott.Prog

Trying to understand -normalize

Post by Scott.Prog » 2007-02-11T12:47:50-07:00

Okay, I've been working with IM trying to determine how to simulate the effect that Photoshop has called Auto Levels.

Here the command I'm running and is based on combing through the forums and documentation looking at examples:

Code: Select all

convert sourceFile.jpg -normalize -enhance -equalize -despeckle -quality 95 destinationFile.jpg
The original image looks like this (my daughter):

Image

After running Photoshop and choosing the Auto Levels:

Image

After running the IM command listed above (I also included some code to square it up and put it on a white background)

Code: Select all

-thumbnail '500x500>' -bordercolor white -border 500 -gravity center -crop 500x500+0+0 +repage
Image

I can guess that the softness is from the -despeckle portion of the command but I don't understand why I'm getting such a weird looking image using the -normalize -enhance -equalize portion.

Any ideas? I'm sure I'm using the IM operators incorrectly but can't seem to hit upon the magic combination. Your help is much appreciated. I'm running this build:
Version: ImageMagick 6.3.2 02/08/07 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC

User avatar
anthony
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Trying to understand -normalize

Post by anthony » 2007-02-11T19:51:14-07:00

Auto-levels isn't just a normalize. and it is equalize that is giving you the weird colors as the histogram is 'leveled'.

Auto-level trys to find the 'bulk' of the colors in the brightness histogram, then linearly stretch out these colors. Im does not have this feature because no one has spent the time to implement it.

There is less than half a dozen of us who even do things in the core regularly.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Scott.Prog

Re: Trying to understand -normalize

Post by Scott.Prog » 2007-02-12T21:41:14-07:00

Ok, so what kind of bribe would be necessary to get something like this added? Amazon wish list? Currency? A nice bottle of single malt Scotch? A mid-priced call girl? :-)

Scott.Prog

Re: Trying to understand -normalize

Post by Scott.Prog » 2007-02-15T08:24:41-07:00

No takers on this? Even for real money?

User avatar
anthony
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Trying to understand -normalize

Post by anthony » 2007-02-18T22:03:38-07:00

Like I said, few people lots to do.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply