Page 1 of 1

Change all pixels of a specific color to a semi-transparent

Posted: 2010-04-30T17:00:14-07:00
by chad182
Full Subject: Change all pixels of a specific color to a semi-transparent color

I have an image (obviously) and I want to change all of the white rgba pixels in the image to a semi-transparent rgba color (i.e. 210,210,210,0.5).

How can I accomplish this?

Thanks in advance!
Chad

Re: Change all pixels of a specific color to a semi-transpar

Posted: 2010-04-30T17:46:39-07:00
by fmw42
convert image -channel rgba -alpha on -fill "rgba(210,210,210,0.5)" -opaque white result

be sure to use png or gif or tiff as jpg does not support transparency


Presumably your image does not have transparency to begin with. If otherwise, then the approach needs to change for the transparency existing on the white parts.