SuperFamiconv icon indicating copy to clipboard operation
SuperFamiconv copied to clipboard

Errors when using no remap, json palettes and 2 BPP mode

Open est77 opened this issue 3 years ago • 2 comments

In the code here: https://github.com/Optiroc/SuperFamiconv/blob/master/src/Palette.cpp#L93, this check seems wrong when using 2 BPP or more that 1 palette. If the check fails, SuperFamiconv throws an exception and enters the catch block and tries to read the json palette as a binary palette with pretty random results.

In my case, I have a 16 colors palette in the original image that I expect SuperFamiconv to convert to 4 palettes with 4 colors each in 2 bpp mode. The check fails because 16 colors is greater than 4.

Using native binary palettes instead seems to work ok.

est77 avatar Feb 13 '21 11:02 est77

Do you have sample JSON input to test with?

Optiroc avatar Feb 15 '21 20:02 Optiroc

Attached the original PNG image and json palette.

hud

hud_pal.json.txt

superfamiconv command:

superfamiconv tiles -i hud.png -p hud_pal.json -d hud_tileset.chr -B 2 -W 8 -H 8 -v -D -F

est77 avatar Feb 16 '21 12:02 est77