A method of run-length encoding an image containing runs of white pixels and black pixels, by acquiring the image to encode; determining the length of all unique pixel run-lengths contained within the image on a line-by-line basis, irrespective of pixel color; selecting a base of a numeral system, where the base is made up of digits; generating a number of unequal-length codewords equal to the base; determining, in order, pixel run-lengths, on a line-by-line basis, for each pixel run-length contained in the image, where counting on each line starts with a particular pixel color; representing each pixel run-length determined in the last step in the numeral system of the base; determining the frequency of occurrence of each digit resulting from the last step; assigning the unequal-length codewords, according to ascending length of the unequal-length codewords, to the digits according to descending order of frequency of occurrence of the digits; and encoding the image by replacing each pixel run-length in the image represented in digit form with the corresponding unequal-length codeword.Method of encoding data to minimize the number of codewords611890412/09/200027/08/19982000747Detch; John LewisRatner; Alan S.US Patent and Trademark OfficeGoogle Patent Searchpatentimages.storage.googleapis.com/pages/US6118904-1.pngUniqueimageunequal-length codewordspixel run-lengthdigitsbasenumeral systemline-by-line basislast stepcorresponding unequal-length codewordparticular pixel color