tepples wrote:
Do you plan on releasing source code so that other interested people can do it?
Here:
https://github.com/pubby/coloradeerI didn't intend for anyone to ever read the source and so it is rightfully rather terrible. There are close to no comments and the identifiers are both non-descriptive and misleading at the same time. But maybe you can figure it out.
To build, you'll need to first "make convert" and then run "./convert art/deer.png"
I never got around to automating this step in the makefile.
tepples wrote:
Interesting. Would it be equivalent to say "each 8x8 pixel tile may contain pixels from no more than three connected regions"? Or is the RGB a tighter bound?
The colored image gets converted to CHR data in a very straightforward way. CHR data can have 4 different colors and that is why my coloration uses 4 colors; R, G, B, and black. I would say that RGB is a tighter bound.
To modify the program to "join" several small regions together, I suggest adding new colors to form bridges between regions.
This maroon color would be considered black when converted to CHR, but otherwise it would be considered red.
tokumaru wrote:
A simpler option might be to remember in RAM what each color of each tile has been recolored to, and apply all 3 transformations on top of the original tile data every time a tile is processed. This is more straightforward and has the benefit of not needing to read from VRAM. You can even implement a pop-up GUI by overwriting part of the picture, and restoring it once the interface is closed.
This is what I'm doing. VRAM is not read from at all in the demo. By "buffer" I really meant "array"; each 8x8 tile takes up 1 byte of RAM, and since there are 1024 tiles this takes up 1024 bytes of space. Colors are encoded in 2 bits segments of these bytes, meaning only 4 colors are possible (3 solid and 1 pattern). However, you could increase the bits-per-color to 8 and still have enough room by combining duplicate tiles.
Quote:
Does this mean you're changing all instances of a specific color in each tile using bitwise operations? What about detecting whether the paint should spill to adjacent tiles?
Changes to the pattern tables are done using bitwise masks against the uncompressed 3-colored image. The inputs are three replacements:
replace R with palette color XX
replace G with palette color YY
replace B with palette color ZZ
Where XX, YY, ZZ are two bits each and they form a byte stored in memory: XXYYZZ00
Quote:
What about detecting whether the paint should spill to adjacent tiles?
Adjacent tiles of the same color are precomputed and stored in lookup tables (nbor_r.bin, nbor_g.bin, nbor_b.bin)
This takes 1.5 KB ROM space per image.