1

I have some images whose type is PaletteAlpha and which have to be TrueColorAlpha. I am trying to use the command

convert testein -type TrueColorAlpha testeou

to do this conversion but the result is an image which still has Type: PaletteAlpha. Is this behaviour expected? How can I transform from one type to the other?

I have also tried things such as PNG:testeou but with no results. My IM version is 6.7.8-9.

TomCho
  • 3,204
  • 6
  • 32
  • 83

1 Answers1

2

The PNG32: prefix forces the output PNG to be RGBA:

convert logo: -transparent white png32:logot32
identify -verbose logot32 | grep Type
  Type: PaletteAlpha
pngcheck logot32
  OK: logot32 (640x480, 32-bit RGB+alpha, non-interlaced, 94.1%).

"identify" reports the "Type" of the image after it has been read in. In this case, it is an image with transparency and fewer than 256 colors, so it's reported as PaletteAlpha.

"pngcheck" reports what's actually stored in the PNG file, which is RGBA.

In fact, "identify" also gives more information about the PNG file. Near the end of the "identify -verbose" output can be found:

Properties:
...
png:IHDR.bit_depth       : 8
png:IHDR.color_type      : 6 (RGBA)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height    : 640, 480
...
Version: ImageMagick 6.7.8-9 2015-06-01 Q16 http://www.imagemagick.org
Glenn Randers-Pehrson
  • 11,940
  • 3
  • 37
  • 61