SuperFamiconv icon indicating copy to clipboard operation
SuperFamiconv copied to clipboard

Colours Don't Fit in Palette error when converting image to 2BPP tilemap.

Open nikku4211 opened this issue 4 years ago • 4 comments

This is the image used: bg0

In the makefile, these arguments were used:

$(SUFACONV) palette -i $< -d bg0.pal -C 4 -v
$(SUFACONV) tiles -i $< -p bg0.pal -d bg0.pic -B 2 -v
$(SUFACONV) map -i $< -p bg0.pal -t bg0.pic -d bg0.map -B 2 -v

This is the error log I got:

superfamiconv -i bg0.png -p bg0.pal -t bg0.pic -m bg0.map -B 2 -v
Loaded image from "bg0.png" (60x160, indexed color)
Mapping optimized palette (8x4 entries for 8x8 tiles)
Setting color zero to #ffffffff
Generated palette with [4,4,4,4,4,4] colors, 24 total
Created optimized tileset with 118 tiles (discarded 42 redudant tiles)
Mapping 160 8x8 image slices
Error: Colors don't fit in palette
make: *** [Makefile:19: bg0.pic] Error 1

I have tried converting the palette, tileset, and tilemap separately, and it seems the problem starts to happen during the tilemap conversion.

This is the log I got for that:

superfamiconv map -i bg0.png -p bg0.pal -t bg0.pic -d bg0.map -B 2 -v
Loaded image from "bg0.png" (60x160, indexed color)
Loaded palette from "bg0.pal" ([4,4,4,4,4,4] colors, 24 total)
Loaded tiles from "bg0.pic" (118 tiles)
Mapping 160 8x8 image slices
Error: Colors don't fit in palette
make: *** [Makefile:22: bg0.pic] Error 1

So the palette was successfully generated, the tiles were successfully generated, but for some reason, the map wasn't? I literally explicitly set the -B BPP command to '2'.

nikku4211 avatar Jan 31 '21 01:01 nikku4211

that is barely readable, you might wanna use code fencing: ``` code ```

basxto avatar Feb 02 '21 21:02 basxto

that is barely readable, you might wanna use code fencing:

code

Thanks lol

nikku4211 avatar Feb 16 '21 00:02 nikku4211

Same problem. I have a picture that each 8x8 tile has 3 colors, but there are 24 colors in total. Superfamiconv throws "colors don't fit in palette" error if total colors >4.

gizaha avatar Apr 19 '21 22:04 gizaha

Your image is not an even number of tiles wide. Pad its right side so it's 64px (8 tiles) wide and it will work.

image

Rangi42 avatar Jul 31 '21 07:07 Rangi42