2. The method of claim 1 , further comprising, after transmitting the encoding, transmitting a subsequent encoding comprising an encoding of a color of each text pixel of the plurality of text pixels, wherein a combination of the encoding of the mask, the encoding of the constant color and the encoding of the color of each of the plurality of text pixels constitutes a lossless encoding of the portion.
1. A method of encoding an image comprising: analyzing, by a computer having one or more processors, colors and spatial features of pixels of the image to identify a text region of the image that is separate from a picture region of the image; generating, by the computer, for a portion of the text region, a mask dividing the portion into background pixels and a plurality of text pixels, wherein the background pixels are identified as pixels with a constant color, the plurality of text pixels are identified as pixels contrasting the constant color, and the plurality of text pixels comprise a plurality of colors; analyzing chrominance values of the plurality of colors to determine a text chrominance; generating, for each text pixel of the plurality of text pixels, a text pixel value to generate a plurality of text pixel values, wherein each text pixel value is based on a luminance of a text pixel for which it was generated; and transmitting an encoding of the portion comprising an encoding of each of the constant color, the mask, the text chrominance and the plurality of text pixel values.