<s>
Run-length	B-Algorithm
encoding	I-Algorithm
(	O
RLE	O
)	O
is	O
a	O
form	O
of	O
lossless	B-Algorithm
data	I-Algorithm
compression	I-Algorithm
in	O
which	O
runs	O
of	O
data	O
(	O
sequences	O
in	O
which	O
the	O
same	O
data	O
value	O
occurs	O
in	O
many	O
consecutive	O
data	O
elements	O
)	O
are	O
stored	O
as	O
a	O
single	O
data	O
value	O
and	O
count	O
,	O
rather	O
than	O
as	O
the	O
original	O
run	O
.	O
</s>
<s>
RLE	O
also	O
refers	O
to	O
a	O
little-used	O
image	O
format	O
in	O
Windows	O
3.x	O
,	O
with	O
the	O
extension	O
rle	O
,	O
which	O
is	O
a	O
run-length	B-Algorithm
encoded	O
bitmap	O
,	O
used	O
to	O
compress	O
the	O
Windows	O
3.x	O
startup	O
screen	O
.	O
</s>
<s>
There	O
will	O
be	O
many	O
long	O
runs	O
of	O
white	O
pixels	B-Algorithm
in	O
the	O
blank	O
space	O
,	O
and	O
many	O
short	O
runs	O
of	O
black	O
pixels	B-Algorithm
within	O
the	O
text	O
.	O
</s>
<s>
A	O
hypothetical	O
scan	B-Algorithm
line	I-Algorithm
,	O
with	O
B	O
representing	O
a	O
black	O
pixel	B-Algorithm
and	O
W	O
representing	O
white	O
,	O
might	O
read	O
as	O
follows	O
:	O
</s>
<s>
With	O
a	O
run-length	B-Algorithm
encoding	I-Algorithm
(	O
RLE	O
)	O
data	O
compression	O
algorithm	O
applied	O
to	O
the	O
above	O
hypothetical	O
scan	B-Algorithm
line	I-Algorithm
,	O
it	O
can	O
be	O
rendered	O
as	O
follows	O
:	O
</s>
<s>
While	O
the	O
actual	O
format	O
used	O
for	O
the	O
storage	O
of	O
images	O
is	O
generally	O
binary	O
rather	O
than	O
ASCII	B-Protocol
characters	I-Protocol
like	O
this	O
,	O
the	O
principle	O
remains	O
the	O
same	O
.	O
</s>
<s>
However	O
,	O
newer	O
compression	O
methods	O
such	O
as	O
DEFLATE	B-Algorithm
often	O
use	O
LZ77-based	O
algorithms	O
,	O
a	O
generalization	O
of	O
run-length	B-Algorithm
encoding	I-Algorithm
that	O
can	O
take	O
advantage	O
of	O
runs	O
of	O
strings	O
of	O
characters	O
(	O
such	O
as	O
BWWBWWBWWBWW	O
)	O
.	O
</s>
<s>
Run-length	B-Algorithm
encoding	I-Algorithm
can	O
be	O
expressed	O
in	O
multiple	O
ways	O
to	O
accommodate	O
data	O
properties	O
as	O
well	O
as	O
additional	O
compression	O
algorithms	O
.	O
</s>
<s>
For	O
instance	O
,	O
one	O
popular	O
method	O
encodes	O
run	B-Algorithm
lengths	I-Algorithm
for	O
runs	O
of	O
two	O
or	O
more	O
characters	O
only	O
,	O
using	O
an	O
"	O
escape	O
"	O
symbol	O
to	O
identify	O
runs	O
,	O
or	O
using	O
the	O
character	O
itself	O
as	O
the	O
escape	O
,	O
so	O
that	O
any	O
time	O
a	O
character	O
appears	O
twice	O
it	O
denotes	O
a	O
run	O
.	O
</s>
<s>
Even	O
with	O
the	O
runs	O
extracted	O
,	O
the	O
frequencies	O
of	O
different	O
characters	O
may	O
be	O
large	O
,	O
allowing	O
for	O
further	O
compression	O
;	O
however	O
,	O
if	O
the	O
run	B-Algorithm
lengths	I-Algorithm
are	O
written	O
in	O
the	O
file	O
in	O
the	O
locations	O
where	O
the	O
runs	O
occurred	O
,	O
the	O
presence	O
of	O
these	O
numbers	O
interrupts	O
the	O
normal	O
flow	O
and	O
makes	O
it	O
harder	O
to	O
compress	O
.	O
</s>
<s>
To	O
overcome	O
this	O
,	O
some	O
run-length	B-Algorithm
encoders	O
separate	O
the	O
data	O
and	O
escape	O
symbols	O
from	O
the	O
run	B-Algorithm
lengths	I-Algorithm
,	O
so	O
that	O
the	O
two	O
can	O
be	O
handled	O
independently	O
.	O
</s>
<s>
Run-length	B-Algorithm
encoding	I-Algorithm
(	O
RLE	O
)	O
schemes	O
were	O
employed	O
in	O
the	O
transmission	O
of	O
analog	O
television	O
signals	O
as	O
far	O
back	O
as	O
1967	O
.	O
</s>
<s>
In	O
1983	O
,	O
run-length	B-Algorithm
encoding	I-Algorithm
was	O
patented	O
by	O
Hitachi	O
.	O
</s>
<s>
RLE	O
is	O
particularly	O
well	O
suited	O
to	O
palette-based	O
bitmap	O
images	O
such	O
as	O
computer	O
icons	O
,	O
and	O
was	O
a	O
popular	O
image	O
compression	O
method	O
on	O
early	O
online	O
services	O
such	O
as	O
CompuServe	O
before	O
the	O
advent	O
of	O
more	O
sophisticated	O
formats	O
such	O
as	O
GIF	O
.	O
</s>
<s>
It	O
does	O
not	O
work	O
well	O
on	O
continuous-tone	O
images	O
such	O
as	O
photographs	O
,	O
although	O
JPEG	O
uses	O
it	O
on	O
the	O
coefficients	O
that	O
remain	O
after	O
transforming	O
and	O
quantizing	B-Algorithm
image	O
blocks	O
.	O
</s>
<s>
Common	O
formats	O
for	O
run-length	B-Algorithm
encoded	O
data	O
include	O
Truevision	O
TGA	O
,	O
PackBits	B-Algorithm
(	O
by	O
Apple	O
,	O
used	O
in	O
MacPaint	B-Operating_System
)	O
,	O
PCX	O
and	O
ILBM	B-Operating_System
.	O
</s>
<s>
The	O
International	O
Telecommunication	O
Union	O
also	O
describes	O
a	O
standard	O
to	O
encode	O
run-length-colour	O
for	O
fax	O
machines	O
,	O
known	O
as	O
T.45	O
.	O
</s>
<s>
The	O
standard	O
,	O
which	O
is	O
combined	O
with	O
other	O
techniques	O
into	O
Modified	B-Algorithm
Huffman	I-Algorithm
coding	I-Algorithm
,	O
is	O
relatively	O
efficient	O
because	O
most	O
faxed	O
documents	O
are	O
generally	O
white	O
space	O
,	O
with	O
occasional	O
interruptions	O
of	O
black	O
.	O
</s>
