I keep getting the following error message on images I've converted to a 256-color palette with GIMP: "Unsupported PNG Image! Make sure you are using a color depth of 8 bit (256 colors)." Only thing is, I'm only getting this particular error on images I know are indexed with 256 colors or less. I've found references to this error message online, but the answers always go something like "either it's the wrong size or it's not in 256-color mode." Well, that doesn't help me here because neither of these are the case. What's weirder is, I'll use GIMP's 'generate optimum palette' feature to convert an image to 256-color mod and have it work just fine, but then I'll convert back to RGB, make some edits, and then generate a 256-color palette again, and then it gives me that error. I've managed to get around this in the past with some finagling (changing directories, importing backup files, pasting my work into separate images, etc.) but whatever I did to get it to work before, I can't get it to import the charset I'm working on at the moment. Any idea what could cause this?
EDIT: As a little experiment, I just added rainbow gradients in an unused part of the image to ensure that the optimum palette is exactly 256 colors and no less. Obviously, that's not going to work as a permanent solution, but it does, reveal an important piece of information: the error seems to arise from the color palette being under, and not equal to, 256 colors.
It appears that what I need is a way to losslessly convert it to a palette of exactly 256 colors.