Using "convert -evaluate-sequence operator" on color images
Posted: 2016-05-16T06:04:35-07:00
Dear ImageMagick users,
When applying the operator Max to a sequence of color images, such as in
it appears that the operator is applied to each RGB channel
separately. This contrasts with the Median operator, which seems to
operate on a single scalar per location to decide which pixel to
retain (some brightness-like value?). Indeed if I replace the Max
operator with Median in the example above, I obtain an image wherein
every pixel is from one of the three source images. If the Median
operator were applied to every channel separately, the result would
be black everywhere (every RGB component is zero in two of the three
images).
The answer to any of the two following questions would help me:
Max and Median operators, but that did not have any effect. This is of
course consistent with the documentation, which does not list
-evaluate-sequence among the options affected by -channel, although it
seemed to be the intuitive answer.
TIA
Adrian
In case it matters, I use imagemagick 6.8.9 on a Debian testing Linux box:
When applying the operator Max to a sequence of color images, such as in
Code: Select all
convert -size 100x100 radial-gradient:'#FF0000'-black \
-size 100x100 gradient:black-'#0000FF' \
-size 100x100 gradient:'#00FF00'-black \
-evaluate-sequence max \
show:
separately. This contrasts with the Median operator, which seems to
operate on a single scalar per location to decide which pixel to
retain (some brightness-like value?). Indeed if I replace the Max
operator with Median in the example above, I obtain an image wherein
every pixel is from one of the three source images. If the Median
operator were applied to every channel separately, the result would
be black everywhere (every RGB component is zero in two of the three
images).
The answer to any of the two following questions would help me:
- is it possible to specify the scalar that Median should operate on ?
Example: retain the pixels of median saturation. - conversely, can one apply the Max operator only to a single channel,
while still copying the entire pixel over to the destination?
Example: retain the pixels of minimum saturation. Other example:
retain the pixels of maximum red level (with their respective
blue and green component): in the example above that would
yield the first radial-gradient image.
Max and Median operators, but that did not have any effect. This is of
course consistent with the documentation, which does not list
-evaluate-sequence among the options affected by -channel, although it
seemed to be the intuitive answer.
TIA
Adrian
In case it matters, I use imagemagick 6.8.9 on a Debian testing Linux box:
Code: Select all
$> uname -a
Linux rouge 4.5.0-1-amd64 #1 SMP Debian 4.5.1-1 (2016-04-14) x86_64 GNU/Linux
$> convert -version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2016-04-08 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr
ltdl lzma openexr pangocairo png tiff wmf x xml zlib