DDJVU(1)

NAME
ddjvu - Command line DjVu decoder.

SYNOPSIS
ddjvu [options] [djvufile] [pnmfile]

DESCRIPTION
This program decodes DjVu file djvufile, produces a raw image, and saves it into file pnmfile using the well known PNM file formats. Omitting the djvufile argument, or specifying a single dash causes the program to read the DjVu data from the standard input. Similarly, omitting the pnmfile argument or specifying a single dash causes the program to write the PNM data to the standard output.

RESOLUTION OPTIONS
Three options control the resolution of the output image. At most one of these three options can be specified. The default resolution is equivalent to specifying -scale 100.

-n  Specify an integer sub-sampling factor. The dimensions of the full output image will be n times smaller than the DjVu image size. The legal values for argument n range from 1 to 12. Option -1, for instance, produces an output image whose resolution is equal to the resolution of the input DjVu image file.

-scale mag
    Specify a magnification factor relative to the resolution stored in the DjVu image. Specifying magnification of 100 produces an image suitable for displaying on a 100 dpi device such as a computer screen. The magnification factor mag can also be interpreted as the resolution of the output image expressed in dot per inch.

-size wxh
    Specify the size of the full output image. Rendering the full DjVu image would create an output image whose width and height would not exceed w and h. To change the aspect ratio, you must also use option -aspect.

-aspect
    This option, when used in combination with option -size, authorizes changes in the aspect ratio.

RENDERING MODE OPTIONS
The default rendering mode merges all the layers of the DjVu image and outputs an adequate PNM file. DjVuPhoto and DjVuDocument images are always rendered as PPM files. DjVuBitonal images are rendered as PBM files if the output image resolution is exactly equal to the DjVu image resolution. Use option -1 to ensure this behavior. DjVuBitonal images are otherwise rendered as anti-aliased PGM files. Three options alter this default behavior.

-black
    Only render the foreground layer mask. This mode does not work with DjVuPhoto images because these files have no foreground layer mask. The output file will be a PBM file if the output image resolution is exactly equal to the DjVu image resolution. Otherwise an anti-aliased PGM file will be generated.

-foreground
    Only render the foreground layer on a white background. This mode works only with DjVuDocument images. The output file will always be a PPM file.

-background
    Only render the foreground layer on a white background. This mode works only with DjVuDocument images. The output file will always be a PPM file.

OTHER OPTIONS

-v  Display informational messages describing the structure of the DjVu image and the CPU times required to decode and render the image.

-page n
    Specify which page of a multi-page DjVu document should be decoded. The default is the first page of the document (page 1).

-segment wxh+x+y
    Specify an image segment to render. Program ddjvu conceptually renders the full page using the specified resolution, and then extracts a sub-image of width w and height h, starting at position (x,y) relative to the bottom left corner of the page. Both operations of course happen simultaneously. Rendering a small sub-image is much faster than rendering the complete image. The output file will always have size wxh when this option is specified.

-rle
    Outputs the foreground layer mask in bitonal rle format. See csepdjvu(1) for information about the bitonal rle format. This option implicitly sets options -1 and -black.

CREDITS
This program was written by Léon Bottou <leonb@users.sourceforge.net> and was then improved by Andrei Erofeev <andrew_erofeev@yahoo.com>, Bill Riemers <docbill@sourceforge.net> and many others.

SEE ALSO
djvu(1), djview(1), pnm(5), pbm(5), pgm(5), ppm(5)