I thought that maybe you could:
- Reduce each 8x8 tile down to 16 colours, producing n 16-colour palettes, then
- Split the n palettes up into four groups based on similarity, then merge the palettes in each group into one
I think the principles are the same either waytepples wrote:This is for still art, such as a title screen, right? Because in a game, you're going to need to reserve some colors for the sprites.
This is really clever, and I was really excited to try it out, so I threw together a Python script for it and ran it on the classic Lena image...but to be honest the results weren't so hottokumaru wrote:The same happens on the NES, where you have to assign one of four palettes to each 16x16-pixel area. What I've done so far is resize the image to 1/16 its size (on the Genesis you'd do 1/8) using linear interpolation, in order to get the average color of each 16x16-pixel block, and then reduce that image to 4 colors. In theory, that would tell you which regions use similar colors, and thus should use the same palette.
Scale that image back to the original size (nearest neighbor this time) and use the areas covered by each of the four colors as selection masks to convert different parts of the original image separately, one conversion per palette.
On the NES, results are less than spectacular, because the low color count makes the attribute clashes very evident, so it's usually better to handpick the palettes to make attribute transitions less harsh. On the Genesis though, where the attribute areas are smaller (8x8 pixels) and there are way more colors per palette, I'd expect much better results from this straightforward technique.


