Fred Weinhaus on  wrote...
| Jan,
| 
| You can use -compose difference to get the absolute difference 
| between two image.
| 
| Then you can use -compose lighten to get the lighter (max) of two 
| images and you can do that in succession to get the lighter of a 
| sequence of images.
| 
| So try this as I think it functionally does what you are trying to do with 
-fx:
| 
| convert image1 image2 image3 ... imageN -average averageimage
| convert \( image1 averageimage -compose difference  -composite \) \
|       \( image2 averageimage -compose difference -composite \) 
| -compose lighten -composite \
|       \( image3 averageimage -compose difference -composite \) 
| -compose lighten -composite \
|       .
|       .
|       .
|       \( imageN averageimage -compose difference -composite \) 
| -compose lighten -composite \
|       resultimage
| 
| Where resultimage should have at each pixel, the furthest absolute 
| value from the mean from all the images.
| 
| Too bad -compose lighten -composite only seems to work correctly two 
| at a time. It would be nice if one can do a list of images as 
| -flatten allows and as -average allows. Would be nice to have a bunch 
| of multi-image operators such as average, min, max, median of a 
| sequence of images operating pixel-by-pixel.
| 
Ohh... yess...

that would be a bug in my previous script.

-flatten has a 'background base image'  As such if you want to
'maximize' values (Lighten) then you will need to also set   -Background
Black!!


My corrected version (for any number of images, in one command)
from my own response is thus...

   convert image?.png \
           \( -clone 0--1 -average \
              null: -clone 0--1 -compose Difference -layers Composite \
              -colorspace Gray \
              \( -clone 0--1  -background Black -compose Lighten -flatten \
                 null: +insert  \) \
              -alpha Set -compose ChangeMask -layers Composite \
              null: +insert \) \
            -alpha set -compose DstIn -layers Composite \
            -background None  -flatten  depth_field_merge.png


Of course I can NOT properly test this without some example images.

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
      `` I want my skin to be its yellowist! '' -- Bart Simpson
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to