[Feature request] Specify -c/--colors
as a DMG grayscale ordering
#1594
Labels
Milestone
-c/--colors
as a DMG grayscale ordering
#1594
When
--colors
are not specified, RGBGFX has a complex heuristic for sorting its palettes, which depends on the invisible PNG encoding. (A grayscale image will be converted differently if it has an indexed palette, which can happen by accident; and if there is no indexed palette, the brightness ordering depends on whether it happens to be grayscale or not.)A common case is to encode four-color grayscale images. This is actually a fragile use case: your PNG might have an indexed PLTE chunk that messes up your expected order; and you may have a pixel error that puts two grays in the same bin, uses RGB mode instead, and sorts by lightness.
The original request for palette specs in #487 also discussed specifying a DMG-style grayscale palette, but it isn't yet a feature.
I think that being able to specify
-c dmg:0xe4
would be very useful. It would require RGBGFX to use grayscale mode, so it would just error if that's not possible, instead of silently doing something different. And the user would have control over the order of those hues.This is something the pret disassemblies (and I think the LADX disassembly as well) would be able to use right away. pret now uses a custom tool to derive appropriate .pal files from colored sprites, which is then passed as
-c gbc:custom.pal
. But most graphics are just grayscale, which relies on them being encoded as 2-bit grayscale PNG. (We could in theory pass-c #fff,#aaa,#555,#000
, but then users who inevitably use inexact colors like #505050 would fail.)(I could have sworn we really had this option at some point, as something like
-d 0xe4
. Then again, I also was pretty sure that pret or one of my projects was already passing-c #fff,#aaa,#555,#000
, but they're not -- if we ever did, it was removed for... some reason.)The text was updated successfully, but these errors were encountered: