fertsphere.blogg.se

Png color palette converter
Png color palette converter















I'm using Debian Buster with ImageMagick 6.9.10-23 Q16 if it matters. (I tried playing with few other options, like -colors 256, -remap a.tga, png8: etc. In essence, I'd like complete color palette to remain exactly the same while converting TGA-> PNG-> TGA.Ĭan imagemagick do that and how (or if not, is there an alternative to coding my own tools)?

#PNG COLOR PALETTE CONVERTER CODE#

Also index values not used in that image should also be preserved at same index position with same value (reason being they're going to be used later by 3rd party code which has hardcoded index values for pixel used in overlays) What I would like is for palette to remain exactly the same (for example, if in TGA index 55 had values R=200 G=150 B=100, the resulting PNG should have same values R=200 G=150 B=100 at same index position 55.

png color palette converter

However, using simple convert a.tga a.png, PNG is created which drops unused palette colors, and other palette values get their indexes changed too. Of those 256 colors, 239 are actually used in image for the pixel values. Source image is TARGA color indexed file, having a standard 8-bit 256-color palette to 24-bit RGB values. png (and back again later), while preserving exact palette that was used. I'm trying to use convert(1) from ImageMagick to convert from.















Png color palette converter