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.

Fred





># Second, analyze the distance of a pixel in each image to the averaged
>pixel and pick the most extreme one
>
>convert average.png test1.png test2.png test3.png test4.png -fx
>"xx=max(max(abs(u[1]-u[0]),abs(u[2]-u[0])),max(abs(u[3]-u[0]),abs(u[4]-u[0])));
>yy=max(max(u[1]-u[0],u[2]-u[0]),max(u[3]-u[0],u[4]-u[0]));
>xx>yy?u[0]-xx:u[0]+xx" out.png
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to