Thank @Ai

Yeah, I came across median cut when I was reading about colour quantisation — could be useful if I ever want to create a palette from an image.
I have some more user interface questions if anyone would like to help:
Firstly, with an indexed colour palette, what should happen if the user deletes a colour from the palette? Aseprite shifts all subsequent colours back and recolours the artwork so that the new indexes match, but I think that would be really confusing in Pixaki. The other options I thought of were to erase all pixels of the deleted colour, or to not allow the colour to be deleted if it's in use. Any thoughts?
My second question is to do with blend modes for layers. Would they be useful or is it not a high priority for most people?
Thanks!