24 Dec 2006 frob   » (Journeyer)

Dear Lazy Web

One commercial software file format stores some raster images (icons) in the format described below:

Offset Length Value
2. . . . . 2. . . . . Width (always 0x20?)
4. . . . . 2. . . . . Height (always 0x20?)
8. . . . . 4. . . . . Size of file
0xE . . . . . . . . . start of transparency 'list'
[right after end of transperency] start of points colors

The start is in the left bottom corner.
Transparency: 1 bit per point
Points: 4 bits for color encoding

It utilizes some kind of RLE algorithm, so if
most significant bit of L=1 -- repeat next byte L&127 times
most significant bit of L=0 -- read L&127 bytes 'literally'.
----

May be you can recognize it as some well-known format?

Example:
00 00
20 00 (Width)
20 00 (Height)
16 00 00 00 (Size)
00 00 ???
02 c0 03 (2 most signif bits in the 1st byte and 2 least signif bits in the 2nd bytes are transparent)
FE 00 (next 7e*8 bits are opaque)
/because transparency was described for all points next bytes are colors/
08 FF 99 FF 99 99 FF 99 FF (2 white /in real transparent/, 2 red /color 9/, 2 white, 2 red points; 2 red, 2 white, 2 red, 2white /transparent again/ points)
FF AA (7f*2 green /color A/ points)
FF AA (7f*2 green /color A/ points)
FF AA (7f*2 green /color A/ points)
FB AA (7b*2 green /color A/ points)
end of file

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!