Fred Weinhaus scripsit:
> P.S. Again,
>
> If you do not need the gamma part of level, then you can do the same 
> thing automatically with
>
> convert image1.png -contrast-stretch 0% image2.png

Thanks, tried to use it but couldn't grok docs and my experiments were
inconclusive. One question to documentation:

"Or, if percent is used, black-out at most black-point % pixels and burn
at most 100% minus white-point% pixels."

This applies strictly to number of pixels, not dynamic range of colors?
For example it will clip 4800 pixels on "white and black sides":

convert image1.png -contrast-stretch 1,1% image2.png

not 3 levels from each side (800x600 pixels, 8-bit depth, 255 levels per
channel)?


> It finds the min and max automatically and stretches the image 
> linearly so that the min becomes black and the max becomes white.
>
> "The channels are stretched in concert. Specify -channel to normalize 
> the RGB channels individually."

So to make auto-level known from GUI graphic programs I need:

convert image1 -channel Red -contrast-stretch 0% \
               -channel Green -contrast-stretch 0% \
               -channel Blue -contrast-stretch 0% image2

Yes, it looks so. I can almost exactly reproduce GIMP auto-level with

convert image1 -channel Red -contrast-stretch 0.75% \
               -channel Green -contrast-stretch 0.75% \
               -channel Blue -contrast-stretch 0.75% image2

(range clipping is often done to "strengthen" colors, grrr)

> Above deprecated (but still supported) in IM 6.4.0-11 but now
>
> convert image -format "%[fx:image.minima]" info:
> convert image -format "%[fx:image.maxima]" info:
> convert image -format "%[fx:image.mean]" info:
> convert image -format "%[fx:standard_deviation]" info:
>
> reports values in range 0 to 1. But you can now do math calculations 
> within these.

Looks like duc info is true also for other values. For me

[EMAIL PROTECTED] ~/jpegs $ convert 7.jpg -format "%[fx:image.minima]" info:
0.0117647

I would expect 0 because appropriate section of identify -verbose output
is:

  Channel statistics:
    red:
      min: 3 (0.0117647)
      max: 215 (0.843137)
      mean: 46.261 (0.181416)
      standard deviation: 31.5845 (0.123861)
    green:
      min: 0 (0)
      max: 206 (0.807843)
      mean: 40.7828 (0.159933)
      standard deviation: 32.9262 (0.129122)
    blue:
      min: 0 (0)
      max: 204 (0.8)
      mean: 29.8439 (0.117035)
      standard deviation: 30.7852 (0.120726)


The same applies to image.maxima

Thank you very much.

m.

_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to