2.50.4: Palette gets shuffled for indexed PNGs during batch processing
Posted: Thu Jun 16, 2022 8:03 pm
XnView: 2.50.4 - 64-bit portable
OS: Windows 10 - 64-bit
When doing batch processing on PNGs with indexed colours, the palette gets shuffled around. As an input, I have one (or more) PNGs that have 16 indexed colours, and do batch processing to convert to a PNG with 256 colours to fill the rest of the palette with black. However, colours 1-15 in the palette are shuffled around. This only happens for Batch Processing. When exporting a single image as a 256-colour PNG through the Export dialogue, it keeps the order of the palette intact.
Effect: Palette gets shuffled, which messes up the colours for other images that rely on that same palette
To reproduce:
1. Have one or more PNGs with 16 indexed colors
2. Use Batch Processing on these PNGs
3. Convert to PNG with transformation: Convert to Colours (256, no dithering)
4. Overwrite the original PNG
Actual behaviour (bug): Color 0 is in the original position. Colors 1-15 are shuffled. Colors 16-255 are black
Expected behaviour: Color 0-15 are in the original positions. Colors 16-255 are black. (This does happen correctly when exporting a single image)
Original palette: Colors 0-15 of the new palette:
OS: Windows 10 - 64-bit
When doing batch processing on PNGs with indexed colours, the palette gets shuffled around. As an input, I have one (or more) PNGs that have 16 indexed colours, and do batch processing to convert to a PNG with 256 colours to fill the rest of the palette with black. However, colours 1-15 in the palette are shuffled around. This only happens for Batch Processing. When exporting a single image as a 256-colour PNG through the Export dialogue, it keeps the order of the palette intact.
Effect: Palette gets shuffled, which messes up the colours for other images that rely on that same palette
To reproduce:
1. Have one or more PNGs with 16 indexed colors
2. Use Batch Processing on these PNGs
3. Convert to PNG with transformation: Convert to Colours (256, no dithering)
4. Overwrite the original PNG
Actual behaviour (bug): Color 0 is in the original position. Colors 1-15 are shuffled. Colors 16-255 are black
Expected behaviour: Color 0-15 are in the original positions. Colors 16-255 are black. (This does happen correctly when exporting a single image)
Original palette: Colors 0-15 of the new palette: