Bug with 32-bit TGA to 256 color png?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
wahweep

Bug with 32-bit TGA to 256 color png?

Post by wahweep »

Hi,
I have a bunch of tga files that I am trying to convert to png. Some of these tga files have alpha channels and others do not. Imagemagick seems to do a really nice job with this conversion except for one issue we have stumbled upon in the color down-sampling (-colors flag). Whenever there is an alpha channel in the tga with a lot of grays that are similar to each other, imagemagick seems to have a problem and writes black pixels to the color channel of the image. The black pixels appear to fill the gray value that is most predominant in the scene, but I can't confirm that.

Photoshop:
-New image (RGB, 8-bit, 64x64)
-Fill the rgb color channel whatever color you want.
-Create an Alpha channel.
-Fill the alpha channel with a 145,145,145 gray. (Pretty much any solid color of gray will cause this. Solid black and solid white appear to give correct results)
-Save the image as a 32-bit tga (targa) file.
-I am running the following command:
convert -verbose c:\temp\png_process\Untitled-1.tga -colors 256 c:\temp\png_process\Untitled-1.png
OR
convert -verbose -colors 256 c:\temp\png_process\Untitled-1.tga c:\temp\png_process\Untitled-1.png
When I open the png in an image editor (fireworks, paint.net, photoshop) the color channel is a solid black.

Am I missing something or is this a bug?

Version Information:
Version: ImageMagick 6.3.2 02/05/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC

I am running WinXP SP2 32-bit, ImageMagick-6.3.2-3-Q16-windows-dll.exe installer, AMD Athlon 3000, 1gig RAM.

Thanks!
(This post is posted in the User forum too because I didn't know if it is something I am doing wrong.)
Post Reply