Use consistent encoding for PNG graphics
All the graphics in LADX are grayscale. However, the exact grayscale hues (and the PNG encodings) differ.
Running file $(git ls-files '*.png' ':!docs/') shows how each file is encoded. To summarize them all:
$ file $(git ls-files '*.png' ':!docs/') | sed -E 's/.+:\s+PNG image data, [0-9]+ x [0-9]+,/PNG,/g' | sort | uniq -c
141 PNG, 2-bit colormap, non-interlaced
29 PNG, 2-bit grayscale, non-interlaced
89 PNG, 8-bit grayscale, non-interlaced
77 PNG, 8-bit/color RGB, non-interlaced
13 PNG, 8-bit/color RGBA, non-interlaced
Some of these in particular have quirks:
- The "2-bit colormap" images have an invisible internal indexed PLTE colormap, which RGBGFX will detect and use as the order of the colors, even if that colormap is not sorted from lightest to darkest.
- The "2-bit grayscale" images have no absolute RGB888 color values, so they end up using #FFFFFF, #AAAAAA, #555555, and #000000, which are darker than the majority of the images in the repo.
- The other formats are more predictable, and have generally been created to use the four colors #FFFFFF, #BFBFBF, #7F7F7F, and #3F3F3F.
I can re-encode them all consistently. Would y'all prefer them to use those four lighter RGB888 colors (#FFFFFF, #BFBFBF, #7F7F7F, #3F3F3F)? Or the darker 2-bit grayscale ones (#FFFFFF, #AAAAAA, #555555, #000000)?
To weight in my opinion. Depending on the color map is not something I think is the best solution, as various image editing software has the tendency to reorder or even throw away those maps. So my preference would be to have RGB(A) images.
I personally don't care about which brightness levels are used exactly.
Same: consistency would be nice, colors maps are finicky, and whichever brightness seems the best to you.
Alright! The current color palettes are:
- (#FFFFFF, #AAAAAA, #555555, #000000): 249
- (#FFFFFF, #BFBFBF, #7F7F7F, #3F3F3F): 73
- (#FFFFFF, #B2B2B2, #6C6C6C, #303030): 16
- (#FFFFFF, #9A9A9A, #434343, #000000): 9
- (#FFFFFF, #B2B1B2, #6C6C6C, #303030): 2
So I'll use the most common darker ones for everything.