1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
.TH LSS16 5 LIBLSS16
.SH NAME
lss16 \- SYSLINUX \(dqad hoc\(dq 16-colour, 6-bit channel-depth image file format LSS16
.SH DESCRIPTION
LSS16 is run-length encoding compressed, lossless an image file format
using a 16-colour palette and sRGB 6-6-6. LSS16 is designed for bootloader splash
images which may be displayed on low-end legacy devices with limited image quality
capabilities. LSS16 does not support transparency.
.PP
LSS16 file consists how two parts: a 56 byte header followed by the pixel encoding.
.PP
Header format:
.RS
4-byte magic number: 3Dh, F3h, 13h, 14h.
Image width (number of pixels horizontally): unsigned 16-bit integer, little endian.
Image height (number of pixels horizontally): unsigned 16-bit integer, little endian,
however the most significant bit most be cleared.
Colour palette: 16 RGB-tuples, each tuple is 3 bytes: red, green, blue.
The two most significant bits in each byte must be cleared.
.RE
.PP
Pixel encoding format:
.RS
The pixels are encoded, row by row, from the top down, in a sequence of nibble. Each
row is encoded from left to right, and odd-nibble rows are padded with a zero-nibble.
Each encoded byte, is split into two nibbles; the lower part of the byte makes up the
first nibble, and the higher part of the byte makes up the second nibble.
At the beginning of each row, the previous pixel is assumed to use the 0-indexed colour.
If a nibble as the value of the the previous pixel colour index, a run-length is encoded,
otherwise the next pixel has the colour with the index encoded in the nibble.
If the nibble encodes a run-length, it can either be 0 or the number of times the
previous pixel is repeated (excluding the already existing pixels). If the nibble
is 0, the next two nibbles, encodes in little-endian, a value
.IR N ,
and the previous pixel is repeated
.IR N +16
times (excluding the already existing pixels).
.RE
.PP
A 6-bit colour-channel
value
.I N
is mapped to 8-bits with the function
.I (N*255+31)/63
(linear scaling).
.PP
LSS16 image files usually have the filename suffix
.RB \(dq .lss \(dq
or
.RB \(dq .16 \(dq.
.SH SEE ALSO
.BR liblss16 (7),
.BR syslinux (1)
|