-
-
Notifications
You must be signed in to change notification settings - Fork 175
Remove legacy palette generation behavior from rgbgfx
without -c
#1062
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
Comments
A few notes:
|
And yes, |
MS Paint will be happy to prove you wrong, and so will many other tools. This is just punishing users. |
"if you're manually controlling the embedded palette, you can presumably make it have just four colors" is true of some tools and not true of others. For example, when using Pillow (Python Imaging Library) to save an indexed image, it's not quite obvious how to make it write a palette with fewer than 256 colors; you have to call |
Please continue discussion of whether unused extra colors should be supported in #1064. So far it sounds like we're in agreement that the legacy behavior of " |
rgbgfx
rgbgfx
without -c
If the user doesn't specify |
Yes, but the current compatibility behavior does mean that identical-looking input images can have different generated palettes depending on this detail of their encoding, which may be surprising even if you don't actually care about the color order. The only use case not already covered by |
If you need an explicit set of colors, possibly including unused ones, use `-c`. Fixes gbdev#1062
If you need an explicit set of colors, possibly including unused ones, use `-c`. Fixes #1062
Currently some people have an indexed PNG with more than 4 colors, which only uses 4 of those colors. The legacy behavior of
rgbgfx
is to use just the 4 colors that are actually used, but keep their order from the indexed palette.The problem with this behavior is that it means identical-looking input images may not give identical output. If image A uses four shades of gray and is encoded as 2-bit grayscale, and image B is identical but uses an indexed 4-color palette (and you don't know the order because most image editors don't make that info available), then image B will have a different 2bpp encoding than you'd expect from the usual sort-by-darkness rule.
This behavior should be removed. The
-c
flag is sufficient; users can specify the four colors they want, or edit their indexed palette to have just those colors.The text was updated successfully, but these errors were encountered: