Pertains to GD2-capable platforms.
For a number of graphics projects Im working on Ive created a new graphics file
format: RLE-compressed PIC files. Based on a suggestion by BSJR, the format
looks like this:
Code: Select all
$00 RLEn .l where n = 1, 2, or 4 for byte, word, long element size
$04 flag .w $4AFC - standard PIC flag
$06 ... remaining 10 byte PIC header; in total 14 bytes long
$0E RLE-compressed data
The uncompressed length can be worked out thus: y-size x line_length, so no need
to specify separately, unlike sprites.
In other words, this is basically the PIC spec headed by a "RLEn" flag.
The RLE format itself is identical to that used for sprites.
Ive been doing some tests with RLE compression on larger objects like (partial)
screen shots, but also of artwork and photo-type images. To me the results seem
promising with, typically, between 90% - 50% compression, and at reasonable
speeds. I have no timings to show yet, but its fast, especially decompression.
For typical screen shots RLE can often return better compression than JPEG! Eg:
A screen shot of a QPAC2 Files window listing 32 files came at 401,390b as a
mode 32 PIC. Converting to BMP24: 150%, JPEG 32%, RLE2 20%.
QL mode PICs are only catered for in a step-motherly way: RLE2 seems to give the
best general results with an average of around 50% compression, which is not
spectacular, but better than nothing.
Unfortunately, SMSQ/E does not provide hooks into the RLE decompression code nor
the various format conversion routines that already are built in to cater for
sprites. However, I have made equivalent toolkits that will do all that, and
they are available to anyone to use.
My upcoming graphics viewer, QuickView (or QV) - and other projects - will
support this format. I mention this here as, since QV etc are intended to cater
for all general QL graphics formats (and the most popular mainstream formats
too), Id hate for another, near-identical-but-incompatible format to turn up
once Im done..
So if anyone has any suggestions for changes or improvements, NOW would be a
good time to bring them up!
As for the file extension, I am still open. Here are some ideas: picc, pcc,
pix,.. Preferences or suggestions?