define png:preserve-colormap not working/not implemented
Hi,
in this thread I discuss an issue with .png files which have a colortable which uses an indexed palette. The problem is that ImageMagick, by default, reduces and reorders the colortable of an image.
Supposedly -define png:preserve-colormap suppresses that and should copy the colormap 1:1 to the processed image. However, it doesn't. This is bugged or not implemented (see discussion).
This is very important for working with sprite files which have to have an indexed palette for performance reasons. Not having this option makes ImageMagick useless for this scenario. Please fix!
It would be good if this worked for the +remap option too. The scenario is that you have multiple images, possibly tiled, not tiled etc. you want to use / show together on a paletted display. You want those images to share a common palette of colors, with the SAME indices for each color entry. This is currently impossible, because ImageMagick (or the PNG encoder) tries to optimize the palette and only stores the colors needed for each individual image.
Is this still not fixed?
Also see #3719. This seems to have been implemented here and updated here. I haven't tried to use it in a while, but I have to agree that this is really useful and necessary for old DOS and console games (think Game Boy Color, Game Boy Advance etc.)
I'm also stuck on this issue, this is for the OpenRCT2 project, here is the StackOverflow link: https://stackoverflow.com/questions/70546137/how-to-preserve-the-color-table-for-an-indexed-png-image
Any help would be appreciated. Thanks.
As far as I know, ImageMagick might not preserve the color table. It will rearrange or add/subtract values depending upon the operation.
I've also noticed this bug.
On a PNG with indexed palette, convert in.png -flip out.png optimizes the palette; i.e. reduces duplicate palette entries and may re-order the palette.
convert in.png -define png:preserve-colormap -flip out.png actually converts it to non-indexed color. The expected behaviour would be to preserve the palette order.
Hi,
I am experiencing this issue as well. The effects are exactly as tetracorp explained.
Same issue here: I would like to preserve colormaps in Bitmaps as well.
Hello,
It has been a while but I was wondering if any advances have been made on this or if this has been noticed at all. Or likewise to know if somebody has managed to work with indexed pngs etc. Thanks.
I've given up on this getting fixed. Moving away from Magick++ for my use case.