<s>
Interleaved	B-Operating_System
Bitmap	I-Operating_System
(	O
ILBM	B-Operating_System
)	O
is	O
an	O
image	O
file	O
format	O
conforming	O
to	O
the	O
Interchange	B-Device
File	I-Device
Format	I-Device
(	O
IFF	B-Device
)	O
standard	O
.	O
</s>
<s>
The	O
format	O
originated	O
on	O
the	O
Amiga	B-Device
platform	I-Device
,	O
and	O
on	O
IBM-compatible	O
systems	O
,	O
files	O
in	O
this	O
format	O
or	O
the	O
related	O
PBM	O
(	O
Planar	O
Bitmap	O
)	O
format	O
are	O
typically	O
encountered	O
in	O
games	O
from	O
late	O
1980s	O
and	O
early	O
1990s	O
that	O
were	O
either	O
Amiga	B-Device
ports	O
or	O
had	O
their	O
graphical	O
assets	O
designed	O
on	O
Amiga	B-Device
machines	O
.	O
</s>
<s>
A	O
characteristic	O
feature	O
of	O
the	O
format	O
is	O
that	O
it	O
stores	O
bitmaps	O
in	O
the	O
form	O
of	O
interleaved	O
bit	O
planes	O
,	O
which	O
gives	O
the	O
format	O
its	O
name	O
;	O
this	O
reflects	O
the	O
way	O
the	O
Amiga	B-Device
graphics	O
hardware	O
natively	O
reads	O
graphics	O
data	O
from	O
memory	O
.	O
</s>
<s>
A	O
simple	O
form	O
of	O
compression	B-Algorithm
is	O
supported	O
to	O
make	O
ILBM	B-Operating_System
files	O
more	O
compact	O
.	O
</s>
<s>
On	O
the	O
Amiga	B-Device
,	O
these	O
files	O
are	O
not	O
associated	O
with	O
a	O
particular	O
file	O
extension	O
,	O
though	O
as	O
they	O
started	O
being	O
used	O
on	O
PC	O
systems	O
where	O
extensions	O
are	O
systematically	O
used	O
,	O
they	O
employed	O
a	O
.lbm	B-Operating_System
or	O
occasionally	O
a	O
.bbm	O
extension	O
.	O
</s>
<s>
ILBM	B-Operating_System
is	O
an	O
implementation	O
of	O
the	O
IFF	B-Device
file	O
format	O
consisting	O
of	O
a	O
number	O
of	O
consecutive	O
chunks	O
,	O
whose	O
order	O
can	O
,	O
to	O
some	O
extent	O
,	O
be	O
varied	O
.	O
</s>
<s>
ILBM	B-Operating_System
files	O
usually	O
contain	O
enough	O
information	O
to	O
allow	O
them	O
to	O
be	O
displayed	O
by	O
an	O
image	O
editing	O
program	O
,	O
including	O
image	O
dimensions	O
,	O
palette	O
and	O
pixel	O
data	O
.	O
</s>
<s>
For	O
ILBMs	B-Operating_System
the	O
BMHD	O
chunk	O
and	O
any	O
other	O
'	O
vital	O
 '	O
chunks	O
must	O
appear	O
before	O
the	O
BODY	O
chunk	O
.	O
</s>
<s>
Will	O
be	O
the	O
same	O
as	O
the	O
file	O
size	O
minus	O
eight	O
bytes	O
(	O
this	O
field	O
and	O
chunkID	O
are	O
not	O
included	O
in	O
the	O
count	O
)	O
FOURCC	O
formatID	O
"	O
ILBM	B-Operating_System
"	O
or	O
"	O
PBM	O
"	O
BYTE[ lenChunk	O
-	O
12 ]	O
content	O
Actual	O
data	O
of	O
the	O
chunk	O
,	O
made	O
up	O
of	O
the	O
other	O
sub-chunks	O
below	O
BYTE	O
pad	O
Optional	O
padding	O
byte	O
,	O
only	O
present	O
if	O
lenChunk	O
is	O
not	O
a	O
multiple	O
of	O
2	O
.	O
</s>
<s>
UINT8	O
mask	O
1	O
=	O
masked	O
,	O
2	O
=	O
transparent	O
color	O
,	O
3	O
=	O
lasso	O
(	O
for	O
MacPaint	B-Operating_System
)	O
.	O
</s>
<s>
UINT8	O
compression	B-Algorithm
If	O
0	O
then	O
uncompressed	O
.	O
</s>
<s>
If	O
2	O
"	O
Vertical	O
RLE	O
"	O
from	O
Deluxe	B-Application
Paint	I-Application
for	O
Atari	O
ST	O
.	O
Other	O
values	O
are	O
theoretically	O
possible	O
,	O
representing	O
other	O
compression	B-Algorithm
methods	O
.	O
</s>
<s>
In	O
ILBM	B-Operating_System
files	O
the	O
BODY	O
chunk	O
stores	O
the	O
actual	O
image	O
data	O
as	O
interleaved	O
bitplanes	O
(	O
and	O
optional	O
mask	O
)	O
by	O
row	O
.	O
</s>
<s>
The	O
compression	B-Algorithm
is	O
a	O
variety	O
of	O
RLE	B-Algorithm
Compression	I-Algorithm
using	O
flags	O
.	O
</s>
<s>
For	O
the	O
compression	B-Algorithm
routine	O
,	O
it	O
's	O
best	O
to	O
encode	O
a	O
2	O
byte	O
repeat	O
run	O
as	O
a	O
replicate	O
run	O
except	O
when	O
preceded	O
and	O
followed	O
by	O
a	O
literal	O
run	O
,	O
in	O
which	O
case	O
it	O
is	O
best	O
to	O
merge	O
the	O
three	O
into	O
one	O
literal	O
run	O
.	O
</s>
<s>
A	O
CAMG	O
chunk	O
is	O
specifically	O
for	O
the	O
Commodore	B-Device
Amiga	I-Device
computer	O
.	O
</s>
<s>
This	O
lets	O
you	O
specify	O
Amiga	B-Device
display	O
modes	O
like	O
"	O
dual	O
playfield	O
"	O
and	O
"	O
hold	O
and	O
modify	O
"	O
.	O
</s>
<s>
It	O
is	O
,	O
not	O
surprisingly	O
,	O
rare	O
outside	O
of	O
Amiga	B-Device
games	O
.	O
</s>
<s>
If	O
you	O
need	O
to	O
convert	O
or	O
display	O
files	O
that	O
might	O
contain	O
meaningful	O
CAMG	O
chunks	O
,	O
see	O
the	O
'	O
Notes	O
on	O
working	O
with	O
ILBM	B-Operating_System
files	O
 '	O
below	O
.	O
</s>
<s>
Remember	O
that	O
if	O
this	O
has	O
an	O
odd	O
number	O
of	O
colours	O
,	O
as	O
per	O
the	O
IFF	B-Device
specification	O
the	O
chunk	O
will	O
be	O
padded	O
by	O
one	O
byte	O
to	O
make	O
it	O
an	O
even	O
number	O
of	O
bytes	O
long	O
,	O
but	O
the	O
pad	O
byte	O
is	O
not	O
included	O
in	O
the	O
chunk	O
's	O
length	O
field	O
.	O
</s>
<s>
It	O
is	O
used	O
by	O
Electronic	O
Arts	O
 '	O
Deluxe	B-Application
Paint	I-Application
program	O
to	O
identify	O
a	O
contiguous	O
range	O
of	O
colour	O
registers	O
or	O
a	O
"	O
shade	O
range	O
"	O
and	O
colour	O
cycling	O
.	O
</s>
<s>
There	O
can	O
be	O
zero	O
or	O
more	O
CRNG	O
chunks	O
in	O
an	O
ILBM	B-Operating_System
file	O
,	O
but	O
all	O
should	O
appear	O
before	O
the	O
BODY	O
chunk	O
.	O
</s>
<s>
Deluxe	B-Application
Paint	I-Application
normally	O
writes	O
4	O
CRNG	O
chunks	O
in	O
an	O
ILBM	B-Operating_System
when	O
the	O
user	O
asks	O
it	O
to	O
"	O
Save	O
Picture	O
"	O
.	O
</s>
<s>
You	O
could	O
write	O
out	O
both	O
if	O
you	O
want	O
to	O
communicate	O
this	O
information	O
to	O
both	O
DeluxePaint	B-Application
and	O
Graphicraft	O
.	O
</s>
<s>
The	O
TINY	O
chunk	O
contains	O
a	O
small	O
preview	O
image	O
for	O
various	O
graphics	O
programs	O
,	O
including	O
Deluxe	B-Application
Paint	I-Application
.	O
</s>
<s>
Sometimes	O
an	O
ILBM	B-Operating_System
file	O
contains	O
only	O
a	O
colour	O
map	O
and	O
no	O
image	O
data	O
.	O
</s>
<s>
Some	O
ILBM	B-Operating_System
files	O
contain	O
'	O
true-colour	O
'	O
information	O
rather	O
than	O
indexed	O
colours	O
.	O
</s>
<s>
If	O
the	O
ILBM	B-Operating_System
file	O
contains	O
a	O
CAMG	O
chunk	O
in	O
which	O
bit	O
7	O
is	O
set	O
(	O
i.e.	O
</s>
<s>
The	O
file	O
expects	O
to	O
make	O
use	O
of	O
the	O
EHB	O
(	O
Extra	O
Half-Brite	O
)	O
mode	O
of	O
the	O
Amiga	B-Device
chipset	O
.	O
</s>
<s>
If	O
the	O
ILBM	B-Operating_System
file	O
contains	O
a	O
CAMG	O
chunk	O
in	O
which	O
bit	O
11	O
is	O
set	O
(	O
i.e.	O
</s>
<s>
0x800	O
in	O
hexadecimal	O
)	O
the	O
file	O
expects	O
to	O
make	O
use	O
of	O
the	O
HAM	O
(	O
Hold-And-Modify	O
)	O
mode	O
of	O
the	O
Amiga	B-Device
chipset	O
.	O
</s>
<s>
Most	O
utilities	O
that	O
work	O
with	O
ILBM	B-Operating_System
and	O
BBM	O
files	O
are	O
rather	O
dated	O
,	O
such	O
as	O
MacPaint	B-Operating_System
or	O
Deluxe	B-Application
Paint	I-Application
.	O
</s>
<s>
IrfanView	B-Protocol
allows	O
viewing	O
files	O
,	O
is	O
free	O
for	O
non	O
commercial	O
use	O
,	O
and	O
can	O
work	O
under	O
Linux	O
.	O
</s>
<s>
Netpbm	B-Language
can	O
convert	O
images	O
from	O
ILBM	B-Operating_System
to	O
its	O
own	O
PPM	O
format	O
and	O
back	O
.	O
</s>
<s>
pixel	O
art	O
graphics	O
editor	O
can	O
load	O
and	O
save	O
ILBM	B-Operating_System
files	O
,	O
but	O
is	O
limited	O
to	O
256	O
colors	O
maximum	O
,	O
so	O
HAM	O
or	O
24-bit	O
ILBM	B-Operating_System
images	O
will	O
not	O
show	O
all	O
colors	O
.	O
</s>
<s>
ImageMagick	B-Language
and	O
GraphicsMagick	B-Application
can	O
also	O
display	O
and	O
convert	O
ILBM	B-Operating_System
images	O
if	O
the	O
ilbmtoppm	O
and	O
ppmtoilbm	O
utilities	O
from	O
Netpbm	B-Language
are	O
installed	O
.	O
</s>
