Convert Gray channels to RGB channels in PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
t11s

Convert Gray channels to RGB channels in PNG

Post by t11s »

I need to create PNGs with 8-bit RGB and Alpha.

Here is what I have:

Format: PNG (Portable Network Graphics)
Type: GrayscaleMatte
Endianess: Undefined
Colorspace: Gray
Channel depth:
Gray: 8-bits
Alpha: 8-bits

But i need it to end up in this format:

Format: PNG (Portable Network Graphics)
Type: TrueColorMatte
Endianess: Undefined
Colorspace: RGB
Channel depth:
Red: 8-bits
Green: 8-bits
Blue: 8-bits
Alpha: 8-bits

I've tried all kinds of things (-type, -colors, -depth) and nothing seems to be able to convert the image from one channel of Gray to channels of Red, Green, Blue.

Thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Gray channels to RGB channels in PNG

Post by snibgo »

-type TruecolorMatte

Edit: I should say: "-type TruecolorMatte" is good if your convert has created the grayscale image, and you want to ensure it is stored as that type.
snibgo's IM pages: im.snibgo.com
Post Reply