The following image coding schemes are applicable to rectangular raster images. Raster image points are assumed to be of square shape. They are numbered sequentially from 1 onwards, starting at the upper left corner, proceeding line by line downwards, each line in turn proceeding from left to right, and ending at the image's lower right corner.
The following example illustrates the numbering scheme for raster image points by showing how the corner points are numbered, assuming an image length of x points and an image height of y points.
This coding scheme applies to rectangular raster images made up of raster points that are either set or not set. This coding scheme does not support any notion of colour. Image data are coded as follows:
Byte(s)
Description
Length
1
image width = X
1
2
image height = Y
1
3 to K+2
image body
K
Coding of image body:
The status of each raster image point is coded in one bit, to indicate whether the point is set (status = 1) or not set (status = 0).
Byte 1:
This coding scheme applies to coloured rectangular raster images. Raster image point colours are defined as references into a colour look-up table (CLUT), which contains a subset of the red-green-blue colour space. The CLUT in turn is located in the same transparent file as the image instance data themselves, at an offset defined within the image instance data.
Image data are coded as follows:
Byte(s)
Description
Length
1
Image width = X
1
2
Image height = Y
1
3
Bits per raster image point = B
1
4
Number of CLUT entries = C
1
5 to 6
Location of CLUT (Colour Look-up Table)
2
7 to K+6
Image body
K
Bits per raster image point:
Contents:
the number B of bits used to encode references into the CLUT, thus defining a raster image point's colour. B shall have a value between 1 and 8.
Coding:
binary.
Number of entries in CLUT:
Contents:
the number C of entries in the CLUT which may be referenced from inside the image body. CLUT entries are numbered from 0 to C-1. C shall have a value between 1 and 2**B.
Coding:
binary. The value 0 shall be interpreted as 256.
Location of CLUT:
Contents:
this item specifies where the CLUT for this image instance may be found. The CLUT is always located in the same transparent file as the image instance data themselves, at an offset determined by these two bytes.
Coding:
Byte 1: high byte of offset into Image Instance File.
Byte 2: low byte of offset into Image Instance File.
Image body:
Coding:
each raster image point uses B bits to reference one of the C CLUT entries for this image instance. The CLUT entry being thus referenced yields the raster image point's colour. The image body is arrayed as for the Basic Colour Image Coding Scheme, that is, starting with the highest bit of the first raster image point's colour information.
Byte 1:
b8
b7
b6
b5
b4
b3
b2
b1
Bit B (MSB) of raster point 1 CLUT reference
Bit B-1 of raster point 1 CLUT reference
Bit B-2 of raster point 1 CLUT reference
... etc
... etc
... etc
... etc
... etc
etc.
Unused bits shall be set to 1.
The CLUT (Colour Look-up Table) for an image instance with C colours is defined as follows:
Contents:
C CLUT entries defining one colour each.
Coding:
the C CLUT entries are arranged sequentially:
Byte(s) of CLUT
CLUT Entry
1-3
entry 0
...
...
3*(C-1) +1 to 3*C
Entry C-1
Each CLUT entry in turn comprises 3 bytes defining one colour in the red-green-blue colour space:
Byte(s) of CLUT entry
Intensity of Colour
1
Red
2
Green
3
Blue
A value of 'FF' means maximum intensity, so the definition 'FF' '00' 00' stands for fully saturated red.
This coding scheme is identical to the Colour Image Coding Scheme as defined in appendix B.2, with the following exception:
Entry number C-1 in the colour look-up table (CLUT), where C is the number of entries in the CLUT, defines transparency. Raster image points which point to this entry are transparent, so that the underlying colour in the display is shown.
The three colour-coding bytes of entry number C-1 in the CLUT are of no importance when referenced from images using the '22' coding scheme.