Originally Posted by yrizoud
Akira: I didn't want to trust the palette because it can include more colors than the original file
It can, but if the user is using it with knowledge, it shouldn't.
If I start up a 32 color mode in Deluxe Paint, I only have the first 32 colors on my palette available, I can only have "extras" that I don't use on the range exceeding 32 in the main palette editor. Also, Deluxe Paint's GUI colors come from whatever the palette you are using has, so sometimes the GUI becomes a problem, but you learn to work around it.
I think the method should be just limiting the palette to a number of colours. As you have a "pixel proportion" checkbox on the screen format/canvas screen, you should also have a "number of colours" selection with 2,4,8,16,32,HB,64,128 and 256 colours. This is how it works in Deluxe Paint, before you even start the software, you have to choose what you want. And iof you want to have extra colours, just limit it to "the first X number of colours will be used when saving" and the rest of the palette will not be saved.