[magick-users] Extract colours and re-combine

Fred Weinhaus fmw at alink.net
Sat Jul 25 09:14:59 PDT 2009


correction:  seems that one has to add -channel rgba -alpha on after 
"image" to enable the transparency.





>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


More information about the Magick-users mailing list