Page 1 of 1

Set Alpha to 1 bit

Posted: 2007-09-18T18:57:46-07:00
by libin_v
Hi all,

I have an image with the following properties
Format: PNG (Portable Network Graphics)
Class: DirectClass
Type: TrueColorMatte
Colorspace: RGB
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Alpha: 8-bit

I want to change the same to the following, ie with Alpha Channel Depth as 1. (I believe, this is what happens when switch from RGB to Indexed in GIMP)
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Type: PaletteMatte
Colorspace: RGB
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Alpha: 1-bit

I tried the "convert in.png -type PaletteMatte -channel Alpha -depth 1 out.png", this did set the Alpha Channel Depth to 1, but also made the image greyscale.

Also tried "convert in.png -type PaletteMatte -channel RGB -depth 8 -channel Alpha -depth 1 out.png" in vain to achieve the same result as above.

Please help me.
--
Regards,
Libin Varghese

Re: Set Alpha to 1 bit

Posted: 2007-09-18T20:21:09-07:00
by magick
Try PNG8, for example,

convert image.tif png8:image.png

Re: Set Alpha to 1 bit

Posted: 2007-09-18T21:16:27-07:00
by libin_v
Thanks for the quick reply.

I tried convert in.png png8:out.png

When I do identify, I get
Type: GreyScaleMatte
Colorscale: GreyScale
Yes, alpha channel depth has become 1. but I don't want gray scale. I want to maintain the RGB

--
Regards,
Libin Varghese

Re: Set Alpha to 1 bit

Posted: 2007-09-23T20:30:36-07:00
by anthony
To force RGB try...

convert in.png -type TrueColorMatte png8:out.png

PNG8 in IM forces GIF like boolean transparency, while TruecolorMatte setting
should force RGB for the other parts.