Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nikku4211 opened this issue Jan 31, 2021 · 4 comments

Comments

@nikku4211
Copy link

nikku4211 commented Jan 31, 2021

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'.

@basxto
Copy link
Contributor

basxto commented Feb 2, 2021

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

@nikku4211
Copy link
Author

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

code

Thanks lol

@gizaha
Copy link

gizaha commented Apr 19, 2021

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.

@Rangi42
Copy link

Rangi42 commented Jul 31, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants