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:
2.50.4: Palette gets shuffled for indexed PNGs during batch processing
Moderators: helmut, XnTriq, xnview, Dreamer
Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing
UPDATE: After playing around a bit, I noticed that this doesn't happen if you also add a "Clear Metadata" (with everything checked) transformation before the "Convert to Colours" transformation. No idea why, though. But at least I can keep using XnView for this purpose right now
EDIT: No, turns out the Metadata thing has nothing to do with this. It was likely because I had done it with images edited and exported by GIMP, which don't have this issue. See below
EDIT: No, turns out the Metadata thing has nothing to do with this. It was likely because I had done it with images edited and exported by GIMP, which don't have this issue. See below
Last edited by Nurio on Fri Jun 17, 2022 10:06 pm, edited 1 time in total.

Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing
please send me a sample file?
Pierre.
Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing
I tried to create some sample files using GIMP, but interestingly, they didn't have this issue at all. Apparently only files I rip from this Pokémon mod have this issue. Here is one such file:
If you follow the steps above, you'll get a file with a shuffled palette. Of course the image itself still appears fine, because it gets updated to match the shuffled palette, but the issue is that in the game, for each Pokémon, there are three other forms that use the very same palette, and they get messed up because (for example) the colour with index 2 is now a different colour
If you follow the steps above, you'll get a file with a shuffled palette. Of course the image itself still appears fine, because it gets updated to match the shuffled palette, but the issue is that in the game, for each Pokémon, there are three other forms that use the very same palette, and they get messed up because (for example) the colour with index 2 is now a different colour

Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing

Pierre.
Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing
That's amazing news. I even see it got fixed already. Thank you!

Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing
This problem is supposed to be fixed in XnView MP 1.01. Please check and confirm the bug fix here.
Pierre.
Re: 2.50.4: Palette gets shuffled for indexed PNGs during batch processing
I did some testing and it does seem to be fixed now! Thank you!
