Is there an easy way to alter the color mode of an output PNG _withou

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
GaiusCoffey
Posts: 2
Joined: 2015-09-09T06:31:14-07:00
Authentication code: 1151

Is there an easy way to alter the color mode of an output PNG _withou

Post by GaiusCoffey »

Hi,
This is probably a newbie question, sorry.

I have a GIF with a transparent background. I want to get a transparent PNG that I can use in InDesign - InDesign doesn't like Color Mode "index", but it is fine with Color Mode "rgb". (Color mode is Photoshop term, I don't know the equivalent in ImageMagick.)

When I convert to PNG, it generates a PNG that Photoshop reports as Color Mode "Index".

When I convert to PNG in the exact same way but resize to any value other than 100%, the PNG is generated with Color Mode "RGB" (which is what I want).

So far, I have not been able to have any effect on the output colour mode _unless_ I resize the PNG. I have tried so far setting colorspace, channel, transparency etc.

So...

Is there an easy way to alter the color mode of an output PNG _without_ resizing?
Thanks,
G
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Is there an easy way to alter the color mode of an output PNG _withou

Post by snibgo »

Try "-type TrueColorAlpha".

If that doesn't work, try prefixing the output filename with "PNG32:".
snibgo's IM pages: im.snibgo.com
GaiusCoffey
Posts: 2
Joined: 2015-09-09T06:31:14-07:00
Authentication code: 1151

Re: Is there an easy way to alter the color mode of an output PNG _withou

Post by GaiusCoffey »

Thanks, the first one didn't work, but the second one worked like a charm.
Much appreciated,
G
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Is there an easy way to alter the color mode of an output PNG _withou

Post by snibgo »

Good.

The "32" means 4 channels (RGBA) each of 8 bits. Use "24" if you don't have alpha, "64" if you want 16 bits per channel, etc.
snibgo's IM pages: im.snibgo.com
Post Reply