DjVu® technology implements two encoding methods, IW44 wavelet-based compression and JB2 data compression, to achieve high encoding ratios while preserving the visual integrity of the original scanned image. For more information about the types of DjVu images that each method supports, see DjVu document types.
IW44 uses wavelet-based algorithms to encode photographs, pictures, background textures, and other continuous-tone images. These low-contrast elements are smoother than text or line drawings; therefore, they can be encoded at a low resolution (typically 100 dpi) and still maintain the appearance of the original image.
IW44 uses little memory to render progressively, zoom, and pan any image segment. This compression method is used to encode the following:
The background layer of all color DjVu documents
The foreground layer of two-layer color DjVu documents
JB2 encodes black and white text and line drawings at full resolution (typically 300 dpi) to preserve their clarity and readability online and in print. This encoding method achieves high compression ratios by implementing soft pattern matching. Soft pattern matching utilizes the similarities between character shapes by encoding each character according to how it differs from a similarly shaped character that has already been encoded. This technique decreases the amount of repetitive image data that is stored and, therefore, results in smaller file sizes.
JB2 is most often used to encode bitonal DjVu documents and the mask of three-layer color DjVu documents. However, this method also supports a mode in which colors are associated with text and line drawings, thus combining the mask and foreground into a single layer. This two-layer color DjVu image is created by specifying the jb2-format option on the command line. The two-layer format results in very small file sizes but is unsuitable for images that contain touching foreground colors.
For more information, see Segmentation Process.