Re: [AD] Palettizing truecolor/hicolor image in datafiles |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Vincent Penquerc'h wrote:
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.
A slight variation of this would be nice: if the bitmap has less than n
colors, then encode each pixel with ceil(log2(n)) bits.
Not sure how it'll affect datafile compression though.
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)).
It would be nice if the patch was attached ;)
--
- Robert Jr Ohannessian
http://bob.allegronetwork.com/
The peer will come and reset your connection. RUN WHILE YOU STILL CAN!