DjVu Image Files

Photo DjVu Image --- Photo DjVu Image files are best used for encoding photographic images in colors or in shades of gray. The data compression model relies on the IW44 wavelet representation. This format is designed such that the IW44 decoder is able to quickly perform progressive rendering of any image segment using only a small amount of memory.

Photo DjVu files are composed of a single "FORM:DJVU" composite chunk. This composite chunk always begins with one "INFO" chunk describing the image size and resolution (see DjVuInfo). One or more additional "BG44" chunks contains the image data encoded with the IW44 representation (see IWPixmap or IWBitmap). The image size specified in the "INFO" chunk and the image size specified in the IW44 data must be equal.

Bilevel DjVu Image --- Bilevel DjVu Image files are used to compress black and white images representing text and simple drawings. Heavily dithered bilevel images are best encoded using Compound DjVu Images. The JB2 data compression model uses the soft pattern matching technique, which essentially consists of encoding each character by describing how it differs from a well chosen already encoded character.

Bilevel DjVu Files are composed of a single "FORM:DJVU" composite chunk. This composite chunk always begins with one "INFO" chunk describing the image size and resolution (see DjVuInfo). An additional "Sjbz" chunk contains the bilevel data encoded with the JB2 representation (see JB2Image). The image size specified in the "INFO" chunk and the image size specified in the JB2 data must be equal.

Compound DjVu Image --- Compound DjVu Files are an extremely efficient way to compress high resolution Compound document images containing both pictures and text, such as a page of a magazine. Compound DjVu Files represent the document images using two layers. The background layer is used for encoding the pictures and the paper texture. The foreground layer is used for encoding the text and the drawings.

Compound DjVu Files are composed of a single "FORM:DJVU" composite chunk. This composite chunk always begins with one "INFO" chunk describing the size and the resolution of the image (see DjVuInfo).

The main component of the foreground layer is a bilevel image named the foreground mask. The pixel size of the foreground mask is equal to the size of the DjVu image. It contains a black-on-white representation of the text and the drawings. This image is encoded in a single "Sjbz" chunk using the JB2 representation.

The foreground layer also contains a small color image, the foreground color image, encoded as a single "FG44" chunk using the IW44 representation (see IWPixmap or IWBitmap). Compound DjVu images are rendered by painting the foreground color image on top of the background color image using the foreground mask as a stencil. The pixel size of the foreground color image is computed by rounding up the quotient of the mask size by an integer sub-sampling factor ranging from 1 to 12. Most Compound DjVu Images use a foreground color sub-sampling factor equal to 12. Smaller sub-sampling factors produce very slightly better images.

The background layer is a color image encoded by an arbitrary number of "BG44" chunks containing successive IW44 refinements (see IWPixmap or IWBitmap). The size of this image is computed by rounding up the quotient of the mask size by an integer sub-sampling factor ranging from 1 to 12. Most Compound DjVu Images use a background sub-sampling factor equal to 3. Smaller sub-sampling factors are adequate for images with a very rich paper texture. Larger sub-sampling factors are adequate for images containing no pictures.

There are no ordering or interleaving constraints on these chunks except that (a) the "INFO" chunk must appear first, and (b) the successive "BG44" refinements must appear with their natural order. The chunk order simply affects the progressive rendering of DjVu images on a web browser.

Alphabetic index Hierarchy of classes