I’m working with 4bpp indexed sprites and have an interesting issue.
Several of my sprites are designed to share the same 16-color palette but when I save sprites that don’t use the first few colors in the palette, the pixels are re-indexed when the image is saved to PNG format. So if I only use color indexes 0x9, 0xa, 0xe, and 0xf in the drawing, when I save the PNG, they are re-indexed as 0x1…0x4 in the PNG file, which makes them look wrong in my application they’re designed for.
Is there a way to write a LUA script that would export the PNG with the indexes unchanged?
Even more useful would be a way to save them with the indexes = mod 16. So color 0xb would save as 0xb, but 0x1b would be saved as 0xb also. Obviously this would require that the sprite only used indexes within the same 16-color ranges, but that would make it much easier to play with multiple 16-color palettes in Aseprite.