Nov-02-2017, 01:25 PM
(This post was last modified: Nov-02-2017, 01:25 PM by matteusbeus.)
I'm a Sega Genesis homebrew developer. I want to write a script to optimise images for the console. I'm hoping to use the Pillow library but don't even know if what I have in mind is possible!
I'd like to take a single image of 216 x 120 with 60 colours. For every 8x8 pixel square (tile) i'd like to take a colour palette and store this in an array of palettes. In an 216 x 120 image there are 405 tiles.
Once I have all 405 tile palettes, I'd like to compare each palette with the next in the array and if they're identical, I'd like to pop the palette off the array and eventually leave myself with a set of unique palettes. I'd then like to whittle these final palettes down to 4 by comparing each tile and finding its palette of best fit.
I'd like to take a single image of 216 x 120 with 60 colours. For every 8x8 pixel square (tile) i'd like to take a colour palette and store this in an array of palettes. In an 216 x 120 image there are 405 tiles.
Once I have all 405 tile palettes, I'd like to compare each palette with the next in the array and if they're identical, I'd like to pop the palette off the array and eventually leave myself with a set of unique palettes. I'd then like to whittle these final palettes down to 4 by comparing each tile and finding its palette of best fit.