Page 1 of 1

Q: Fill everything except of transparency area

Posted: 2011-04-30T08:50:41-07:00
by llap
Hi there,

this is day three of my odyssey, so please forgive my question. I normally find what I'm looking for by searching for it, not by asking for help.

Problem: I've got a picture to fill. Exactly: An area that is defined by being NOT transparent and being completely enclosed by a fully transparent area.

I know ImageMagick can do that. This this is amazing! But.... how? *sigh*

Kind regards,

Peter

Re: Q: Fill everything except of transparency area

Posted: 2011-04-30T10:11:52-07:00
by fmw42
First line is just to create a test image from the logo: IM internal image:

convert logo: -resize 50% -transparent white logo2t.png

Now color the non-transparent parts red:

convert logo2t.png \
-channel rgb -fill red -colorize 100% +channel \
logo2t_red2.png

or

convert logo2t.png \
\( -clone 0 -alpha off -fill red -colorize 100% \) \
\( -clone 0 -alpha extract \) \
-delete 0 -compose copy_opacity -composite \
logo2t_red.png