rgbds icon indicating copy to clipboard operation
rgbds copied to clipboard

Assertion fails in RGBGFX

Open Rangi42 opened this issue 1 year ago • 6 comments

foo.png

RGBGFX somehow thinks a 5-color tile has 13 colors:

$ ./rgbgfx -n 64 foo.png
warning: Fusing colors #00447eff and #00407dff into Game Boy color $3d00 [first seen at x: 17, y: 120]
FATAL: Tile at (152, 224) has 13 opaque colors, more than 4!
Conversion aborted after 1 error

If the tile is edited to have 4 colors, an assertion is tripped:

$ ./rgbgfx -n 64 -o foo2.2bpp foo2.png
warning: Fusing colors #00447eff and #00407dff into Game Boy color $3d00 [first seen at x: 17, y: 120]
rgbgfx: src/gfx/process.cpp:733: static uint16_t TileData::rowBitplanes(const Png::TilesVisitor::Tile&, const Palette&, uint32_t): Assertion `index < palette.size()' failed.
Aborted (core dumped)

Notes:

  • Editing #00447e and #00407d to be the same color to avoid fusing has no effect on these issues.

Rangi42 avatar Oct 03 '24 00:10 Rangi42