Not quite sure about what you want, but taking a stab -- use
transparent for the background
A)
convert \( image -fuzz XX1% -fill none +opaque color1 \) \
\( image -fuzz XX2% -fill none +opaque color2 \) \
\( image -fuzz XX3% -fill none +opaque color3 \) \
...
\( image -fuzz XXN% -fill none +opaque colorN \) \
-background yourbackgroundcolor -flatten resultimage
B)
convert \( image -fuzz XX1% -fill none +opaque color1 -write image1 \) \
\( image -fuzz XX2% -fill none +opaque color2 -write image2 \) \
\( image -fuzz XX3% -fill none +opaque color3 -write image3 \) \
...
\( image -fuzz XXN% -fill none +opaque colorN -write imageN \) \
null:
convert image1 image2 image3 ... imageN -background
yourbackgroundcolor -flatten resultimage
If all the fuzz percents are the same, I think you can pull the -fuzz
XX% outside the parenthesis and have it just once at the beginning
and they will all use that one value. Possibly the same with the
-fill none. But I have not tried that.
> >> -fuzz XX% -fill backgroundcolor +opaque yourcolor
>
>Thanks to Fred and Anthony for the response above, it works!
>
>But to take it further, I want to
>
>a) Extract certain colours from a multi coloured image and
>then combine the extracted areas in a composite image, with all
>other colours changed to a background colour.
>
>b) The same as a) but creating individual images (which may
> be inspected and modified a little as individual images)
> then combining the lot to achieve a composite image as in a).
>
>I did try various command combinations but always ended up with
>the final image consisting of only the background.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users