palette -> truecolor conversion doesn't work

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.
Locked
thambs
Posts: 1
Joined: 2020-02-23T05:33:48-07:00
Authentication code: 1152

palette -> truecolor conversion doesn't work

Post by thambs »

It looks like there is a problem with .tga-files conversion from an "indexed palette" to a "truecolor" format. I tried:

Code: Select all

identify -verbose cc.tga |egrep "Type|Geometry"
  Geometry: 256x256+0+0
  Type: Palette
convert -verbose -type truecolor cc.tga dd.tga 
cc.tga TGA 256x256 256x256+0+0 8-bit sRGB 256c 123KB 0.000u 0:00.000
cc.tga=>dd.tga TGA 256x256 256x256+0+0 8-bit TrueColor sRGB 196KB 0.010u 0:00.010
And I got

Code: Select all

identify -verbose dd.tga |egrep "Type|Geometry"
  Geometry: 256x256+0+0
  Type: Palette
However, it works with -resize option

Code: Select all

convert -verbose -type truecolor -resize 25% cc.tga dd.tga
cc.tga TGA 256x256 256x256+0+0 8-bit sRGB 256c 123KB 0.000u 0:00.000
cc.tga=>dd.tga TGA 256x256=>64x64 64x64+0+0 8-bit TrueColor sRGB 12.4KB 0.000u 0:00.000
identify -verbose dd.tga |egrep "Type|Geometry"          
  Geometry: 64x64+0+0
  Type: TrueColor
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 from ubuntu 18.04

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

Re: palette -> truecolor conversion doesn't work

Post by snibgo »

You are using ImageMagick to read a TGA and find how IM has stored the pixels in memory: palette or truecolor. This does not mean the pixels were stored in the file in that format.

I don't know what tool wold tell you how pixels are stored in a TGA file. But a good guess is: how many bytes are used per colour pixel? If one, then palette, if three then truecolor.
snibgo's IM pages: im.snibgo.com

Locked