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.h). One or more additional "BG44" chunks contains the image data encoded with the IW44 representation (see IW44Image.h). 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. 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.h). An additional "Sjbz" chunk contains the bilevel data encoded with the JB2 representation (see JB2Image.h). 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). Additional chunks hold the components of either the foreground or the background layers.
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 by a "Sjbz" chunk using the JB2 representation. There may also be a companion chunk "Djbz" containing a shape dictionary that defines bilevel shapes referenced by the "Sjbz" chunk.
The foreground colors can be encoded according to two models:
- The foreground colors may be encoded using a small color image, the foreground color image, encoded as a single "FG44" chunk using the IW44 representation (see IW44Image.h). Such 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 of 12. Smaller sub-sampling factors produce very slightly better images.
- The foreground colors may be encoded by specifying one solid color per object described by the JB2 encoded mask. These JB2 colors are color-quantized and stored in a single "FGbz" chunk (see. DjVuPalette.h). Such compound DjVu images are rendered by painting each foreground object on top of the background color image using the solid color specified by the "FGbz" chunk.
The background layer is a color image, the background color image ncoded by an arbitrary number of "BG44" chunks containing successive IW44 refinements (see IW44Image.h). 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.
Alternative encodings --- Besides the JB2 and IW44 encoding schemes, the DjVu format supports alternative encoding methods for its components.
In addition, the chunk names "BG2k" and "FG2k" have been reserved for encoding the background color image and the foreground color image using the forthcoming JPEG-2000 standard. This capability is not implemented at the moment. The JPEG-2000 standard may even become the preferred encoding method for color images in DjVu.
- The foreground mask may be represented by a single "Smmr" chunk instead of "Sjbz". The "Smmr" chunk contains a bilevel image encoded with the Fax-G4/MMR method. Although the resulting files are typically six times larger, this capability can be useful when DjVu is used as a front-end for fax machines and scanners with embedded Fax-G4/MMR capabilities.
- The background color image may be represented by a single "BGjp" chunk instead of several "BG44" chunks. The "BGjp" chunk contains a JPEG encoded color image. The resulting files are significantly larger and lack the progressivity of the usual DjVu files. This is useful because some scanners have embedded JPEG capabilities.
- The foreground color image may be represented by a single "FGjp" chunk instead of a single "FG44" chunk. This is useful because some scanners have embedded JPEG capabilities.
Alphabetic index Hierarchy of classes