Re: GM -normalize without clipping highlights

Bob Friesenhahn <[email protected]> Tue, 20 Jul 2010 10:58:30 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
On Tue, 20 Jul 2010, [email protected] wrote:

> Here is a procedure that normalizes without clipping the highlights.
>
>    1. convert to linear colorspace
>    2. run "identify" to find the max and min values of
>       each channel.  Chose the maximum of the R,G,B maxima
>       and the minimum of the R,G,B minima
>    3. convert -level max/1.0/min image.in image.out
>    4. convert to the colorspace you want, such as sRGB.
>
> This doesn't address the original poster's request to compress
> the highlight range using some sort of sigmoid transformation,
> but with a little more work that can probably be done.

There are a few issues with the above.  The first step is to convert 
to a "linear" colorspace but it seems likely that the desire is linear 
intensity steps (what the human eye sees) rather than true 
linear-light (what a CCD measures).  Depending on how 'dcraw' is being 
executed, it may be producing raw linear-light data.  This linear 
light data may not be correctly scaled to computer-ranged sRGB (or 
some similar space) by performing a gamma correction since it also 
needs to be scaled into the correct range.

In step #3, the middle parameter is a gamma correction to apply to the 
data so if you knew the magic parameters to use then converting to 
linear intensity with necessary clipping and scaling could be done in 
a single step.

>From what I have seen, 'dcraw' has the best access to the camera raw 
data information (including proprietary camera metadata) so it will 
always be more competent at applying automatic corrections than 
follow-on software like GraphicsMagick.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first