I have been thinking about making a tool to convert images to NES (meta)sprite definitions. Input is two files, the image file and a palette file. Output is the metasprite layout (tile, colorset and relative coordinates for each hardware sprite) and the corresponding CHR tiles. Palette file is needed to properly handle "layered" sprites (i.e. sprites on top of others to get more colors).
Generating optimal sprite definitions is not a trivial problem for layered sprites when many colorsets share the same colors. For example, if we have a sprite with size 16x8 which contains a horizontally centered 8x8 square, it wouldn't make sense to generate two h/w sprites out of it. I have yet to come up with a good algorithm for this.
As an example, the palette file could be something like this (4 colorsets, 3 colors each):
And the image to be converted something like this:
I was wondering if anybody has done a tool like this before?
Generating optimal sprite definitions is not a trivial problem for layered sprites when many colorsets share the same colors. For example, if we have a sprite with size 16x8 which contains a horizontally centered 8x8 square, it wouldn't make sense to generate two h/w sprites out of it. I have yet to come up with a good algorithm for this.
As an example, the palette file could be something like this (4 colorsets, 3 colors each):
And the image to be converted something like this:
I was wondering if anybody has done a tool like this before?