Restoring quantum range after -evaluate min max

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
geoland
Posts: 74
Joined: 2015-05-14T05:11:38-07:00
Authentication code: 6789

Restoring quantum range after -evaluate min max

Post by geoland »

A short query.

Having applied -evaluate min=% and -evaluate max=%

where % = a chosen value

Is quantum range restored to the image automatically with the new values applied or is it necessary to normalize or auto-level the image.

I may be missing a salient point about IM operation.
Last edited by geoland on 2017-04-20T17:34:26-07:00, edited 1 time in total.
Version: ImageMagick 7.0.7 (latest compiled from source) Q32 x86_64 (as of) 2018 - 04 - 31 xubuntu
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Restoring quantum range after -evaluate min max

Post by fmw42 »

I do not think the image will be automatically stretched to full dynamic range by using -evaluate min or max. It just sets the upper/lower bound.
geoland
Posts: 74
Joined: 2015-05-14T05:11:38-07:00
Authentication code: 6789

Re: Restoring quantum range after -evaluate min max

Post by geoland »

-auto-level might be necessary then.
Version: ImageMagick 7.0.7 (latest compiled from source) Q32 x86_64 (as of) 2018 - 04 - 31 xubuntu
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Restoring quantum range after -evaluate min max

Post by fmw42 »

Code: Select all

convert -size 256x256 gradient: -evaluate min 50% result.png
Shows that the maximum value will be 50% gray and minimum value is 0. So it just clips at that value and does not stretch again to full dynamic range.

If you want it stretched, use -level or -contrast-stretch or add -auto-level after -evaluate
geoland
Posts: 74
Joined: 2015-05-14T05:11:38-07:00
Authentication code: 6789

Re: Restoring quantum range after -evaluate min max

Post by geoland »

Thanks Fred. That's what I thought. Saved me a lot of playing around.
Version: ImageMagick 7.0.7 (latest compiled from source) Q32 x86_64 (as of) 2018 - 04 - 31 xubuntu
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Restoring quantum range after -evaluate min max

Post by snibgo »

wrote:Is quantum range restored to the image automatically with the new values applied or is it necessary to normalize or auto-level the image.
IM operations don't auto-level. If you want this, you need to explicitly ask for it.
snibgo's IM pages: im.snibgo.com
Post Reply