Right now, DM saves pngs using compressed RGBA, but png supports storing a palette chunk (up to 256 col(u)ors), and just storing palette indexes (compressed still), supporting a much much smaller bit depth for the actual data. Most DMI files have less than 256 colors, so this would massively reduce rsc sizes.
For shits and giggles, i tried it on a few of our dmis, and their size went to half or a third, a few of the less complex bigger ones went to less then 1/4 size.
Being able to cut a 60mb rsc download to ~10-25mb is way too easy of a target to pass up.
ID:2127953
Aug 7 2016, 12:39 am (Edited on Sep 16 2016, 4:29 am)
|
|||||||
| |||||||
Aug 7 2016, 3:34 am
|
|
IIRC DM only saves *transparent* dmis with compressed RGBA. Fully opaque icons are saved as paletted RGB.
|
ya, i'm guessing whoever did the png stuff in byond didn't notice that you CAN in fact do transparency with palettes.
You just encode the palettes' transparency in a tRNS, as a parallel array of transparency to go with each palette entry. you can even do partially transparent palette entries first, then only add tRNS for those entries, skipping them for the rest, and png assumes 255 alpha for the missing palettes, if you want to save space. |