Page 1 of 1

Convert to grayscale , keep transparency

Posted: 2008-06-06T03:15:36-07:00
by mdibango
Hi ,

My problem is that i don't see how to convert a png image with a transparent background and keeping it transparent.
With

Code: Select all

convert -type Grayscale "picture.png" "picture_nb.png"

transparency become black background.

If anyone can help.

Thank you

Re: Convert to grayscale , keep transparency

Posted: 2008-06-06T12:08:31-07:00
by fmw42
here is an example

create color image with transparent background

convert logo: -transparent white logot.png

change to gray with transparent background

convert logot.png -colorspace gray logotg.png

or

convert logot.png -channel RGBA -matte -colorspace gray logotg.png

Re: Convert to grayscale , keep transparency

Posted: 2008-06-08T01:03:17-07:00
by mdibango
It's working

thanks a lot

Re: Convert to grayscale , keep transparency

Posted: 2008-06-09T19:27:17-07:00
by anthony