[AD] Palettizing truecolor/hicolor image in datafiles |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
This patch changes the format of BITMAP and RLE_SPRITE object
in DATAFILEs. If the image has less than 256 colors (or 255 if
it doesn't containt the mask color), it is transparently palettized
on save and expanded on load if it would gain space. This process
is lossless.
I'd be curious to know if it works on machines with slightly odd
color format (eg BGR, etc).
Valkin 2 demo 2 archive went from 11 megs to 8 megs :)
Also, the lookup is linear, but it would be easy to add binary
search for colors if the slowdown on saving is too much (it is
sensible for a 4.5 megs datafile (2 megs after the patch)).
--
Vincent Penquerc'h
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |