Most of the data compression strategies currently used for black/white (one-bit gray-scale) images involve the detection and noiseless encoding of a specified set of image features, the most common features being "runs" of adjacent equal.valued picture elements. A procedure is provided that, given the frequency distribution for a particular set of features in a sample of images, calculates an extended run-length code (ERLC) that includes two classes of codewords: "regular" codewords for the runs and "special" codewords for the other image features. An ERLC is shown to be highly efficient for the sample images, uniformly efficient for similar images not in the sample, and easily implemented. An encoder and the corresponding decoder are described which can implement any ERLC that includes up to

regular codewords and

special codewords, where

and

are design parameters. Neither the encoder nor the decoder requires a table of codewords; rather, both are controlled by two auxiliary tables that include only
![\\ell _{\\max } [\\log _{2} R]](/images/tex/6830.gif)
-bit entries and
![\\ell _{\\max } [\\log _{2} S]](/images/tex/6831.gif)
-bit entries, respectively, where

is the length of the longest codeword.