SuperFamiconv icon indicating copy to clipboard operation
SuperFamiconv copied to clipboard

No matching tile when not remapping colors

Open H-A-M-G-E-R opened this issue 9 months ago • 4 comments

Image I got this image from https://en.wikipedia.org/wiki/Serris%2C_Seine-et-Marne (not to be confused with the Metroid Fusion boss of the same name), used https://rilden.github.io/tiledpalettequant/ to reduce the colors to 4bpp snes, this should work, but got an error instead superfamiconv -i Serishoteldeville-8x8-8p16c-t.png -p palettes.bin -t tiles.bin -m map.bin -R

  No matching tile for position 0,24
  No matching tile for position 8,24
  No matching tile for position 24,24
  No matching tile for position 32,24
  No matching tile for position 80,24
  No matching tile for position 88,24
  No matching tile for position 96,24
  No matching tile for position 152,24
  No matching tile for position 160,24
  No matching tile for position 168,24
  No matching tile for position 176,24
  No matching tile for position 184,24
  No matching tile for position 0,32
  No matching tile for position 8,32
  No matching tile for position 24,32
  No matching tile for position 32,32
  No matching tile for position 48,32
  No matching tile for position 56,32
  No matching tile for position 64,32
  No matching tile for position 72,32
  No matching tile for position 80,32
  No matching tile for position 88,32
  No matching tile for position 96,32
  No matching tile for position 104,32
  No matching tile for position 128,32
  No matching tile for position 136,32
  No matching tile for position 144,32
  No matching tile for position 152,32
  No matching tile for position 192,32
  No matching tile for position 200,32
  No matching tile for position 208,32
  No matching tile for position 0,40
  No matching tile for position 8,40
  No matching tile for position 16,40
  No matching tile for position 24,40
  No matching tile for position 32,40
  No matching tile for position 40,40
  No matching tile for position 48,40
  No matching tile for position 80,40
  No matching tile for position 88,40
  No matching tile for position 96,40
  No matching tile for position 104,40
  No matching tile for position 112,40
  No matching tile for position 120,40
  No matching tile for position 128,40
  No matching tile for position 184,40
  No matching tile for position 232,40
  No matching tile for position 8,48
  No matching tile for position 16,48
  No matching tile for position 24,48
  No matching tile for position 32,48
  No matching tile for position 40,48
  No matching tile for position 48,48
  No matching tile for position 88,48
  No matching tile for position 0,72
  No matching tile for position 8,72
  No matching tile for position 16,72
  No matching tile for position 24,72
  No matching tile for position 32,72
  No matching tile for position 40,72
  No matching tile for position 48,72
  No matching tile for position 0,80
  No matching tile for position 8,80
  No matching tile for position 0,88

Removing the -R flag makes it be converted properly

H-A-M-G-E-R avatar Mar 25 '25 01:03 H-A-M-G-E-R

Can you supply the PNG generated by the palette quantization tool?

Optiroc avatar Mar 25 '25 17:03 Optiroc

Can you supply the PNG generated by the palette quantization tool?

It's on the above

H-A-M-G-E-R avatar Mar 25 '25 22:03 H-A-M-G-E-R

One other question for H-A-M-G-E-R: When generating your image using Tiled Palette Quantizer, what number did you use for "Bits per channel"? I've found if you use a number larger than 5, then the error you describe above has a chance of occurring when you run SuperFamiconv on it with the "don't remap colors" option.

This similar but distinct image does not trigger the error when -R is included in the command: Image

As for why, the issue seems to occur when two or more colors on the same palette row with very similar RGB values get scaled down to the exact same values. Any tiles with these colors in them will return the "No matching tile for position x,y" error.

In the PNG shared in the issue description:

  • Index 5B hex/91 dec has the RGB values 159, 166, 179
  • Index 5F hex/95 dec has the RGB values 152, 161, 176

When scaled down to the 5-bit-per-channel SNES colorspace, both of the indices above become 19, 20, 22.

The same will also occur if two or more colors on the same palette row have the exact same RGB values before being scaled down. As is, an input image with the same color for both the transparent index and one of the opaque indices on a palette row cannot be used with the don't remap colors setting, as the error will always occur.

Mattrizzle avatar Aug 04 '25 02:08 Mattrizzle

I use LibreSprite to edit indexed-color images

H-A-M-G-E-R avatar Oct 25 '25 22:10 H-A-M-G-E-R