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

Palette generation for SNES is broken as of commit 9236a2a #60

Open
CataLatas opened this issue Jan 12, 2025 · 0 comments
Open

Palette generation for SNES is broken as of commit 9236a2a #60

CataLatas opened this issue Jan 12, 2025 · 0 comments

Comments

@CataLatas
Copy link

As the title says, commit 9236a2a appears to have broken SNES palette generation.

Running a basic test against the previous commit (cbef58a) with the command superfamiconv palette -W16 -H8 -P1 -C16 -R -i testinput.png -j testpalette.json, I get the following results:

Bad palette JSON (commit 9236a2a):

{
  "palettes": [
    [
      "#000000",
      "#424200",
      "#000039",
      "#84007b",
      "#18d600"
    ]
  ],
  "palettes_native_rgb": [
    [
      [
        32,
        0,
        32
      ],
      [
        8,
        8,
        32
      ],
      [
        32,
        0,
        7
      ],
      [
        16,
        32,
        15
      ],
      [
        3,
        26,
        32
      ]
    ]
  ]
}

Good palette JSON (commit cbef58a):

{
  "palettes": [
    [
      "#ff00ff",
      "#4242ff",
      "#ff0039",
      "#7bff7b",
      "#18d6ff"
    ]
  ],
  "palettes_native_rgb": [
    [
      [
        31,
        0,
        31
      ],
      [
        8,
        8,
        31
      ],
      [
        31,
        0,
        7
      ],
      [
        15,
        31,
        15
      ],
      [
        3,
        26,
        31
      ]
    ]
  ]
}

The test input image is the following:
testinput

To me it looks like it's erroneously rouding up the 255 (31) color values to 32.

I haven't checked other modes except for SNES.

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

1 participant