CSEPDJVU(1)
๐ NAME ๐
okay so bestie, listen up โ csepdjvu is the DjVu encoder for separated data files. that's it, that's the whole vibe. โจ
๐ธ SYNOPSIS ๐ธ
csepdjvu [options] [sepfiles]... outputdjvufile
๐ฆ DESCRIPTION ๐ฆ
so here's the tea: this program builds a DjVuDocument file called outputdjvufile out of separated data files called sepfiles. ๐ซถ
and like, plot twist โ you can feed it separated data from standard input by giving it a single dash - instead of the actual separated data file names. that feature is literally made for pre-processing programs that push separated data into csepdjvu through a pipe. iykyk. ๐
each separated data file represents one or more page images. the way that works:
- when the program arguments specify multiple pages, all the pages get encoded and saved as a bundled multi-page document. ๐
- when the program arguments specify a single page, that page gets encoded and saved as a single page file. โจ
๐ OPTIONS ๐
-d nโ sets the resolution info baked into the output file, in dots per inch. the resolution info inside DjVu files is what decides how the decoder scales the image on a particular display. meaningful resolutions range from 25 to 6000. the default value is300dpi. ๐-q n,...,n-q n+...+nโ sets the encoding quality of the IW44 encoded background layer. the option argument holds several integers (one per chunk) separated by either commas or pluses. this option is similar to option-sliceof programc44. go peek at thec44(1)man page for the extra deets. the default quality specification is-q 72,83,93,103. ๐
lowkey important: this option does not apply to uniformly white backgrounds that weren't specified by the separated data but are called for by the DjVu specification. those background images always come at the lowest possible resolution and with a standard quality setting that ensures the color uniformity. no cap.
-tโcsepdjvuinterprets certain comments in the separated file to construct a hidden text layer in the DjVu file. this layer records the location of each word for hiliting purposes. this option reduces the file size by simply recording the location of each line. ๐-vโ displays a brief message describing each page. ๐ง-vvโ displays extensive informational messages during encoding. ๐ (in a fun way)
๐ฅ SEPARATED DATA FILE FORMAT ๐ฅ
each separated data file contains a concatenation of one or more separated page images. each page is logically represented by a foreground image with a transparent color and by a background image visible through the transparent pixels. ๐
the data for each separated page image is the concatenation of the following data blocks:
- a foreground image encoded using either the
"Color RLE format"or the"Bitonal RLE format". these formats are described later in this section. โจ - an optional background image encoded as a
"Portable Pixmap"(PPM). this well known format is summarized later in this section. if there's no background image, that simply indicates a uniformly white background should be assumed. ๐ซถ - an arbitrary number of comment lines starting with character
"#"and terminated by a linefeed character. comment lines whose first word starts with a capital letter have special meanings documented later in this document. ๐
the dimensions (width and height) of the background image must be obtained by rounding up the quotient of the foreground image dimensions by an integer reduction factor ranging from 1 to 12.
assume, for instance, that the width of the foreground is 2507 and the reduction factor is 3. the width of the background image will be the integer ratio (2507+2)/3. ๐งฎ
๐ Color RLE format ๐
the Color RLE format is a simple run-length encoding scheme for color images with a limited number of distinct colors. ๐จ
the data always begin with a text header composed of the two characters "R6", the number of columns, the number of rows, and the number of color palette entries. all numbers are expressed in decimal ASCII. these four items are separated by blank characters (space, tab, carriage return, or linefeed) or by comment lines introduced by character "#". the last number is followed by exactly one character which usually is a linefeed character. ๐
the header is followed by the color palette containing three bytes per color entry. the bytes represent the red, green, and blue components of the color.
the palette is followed by a collection of four bytes integers (most significant bit first) representing runs of pixels with an identical color. ๐ฅ
- the twelve upper bits of this integer indicate the index of the run color in the palette entry.
- the twenty lower bits of the integer indicate the run length.
color indices greater than 0xff0 are reserved. color index 0xfff is used for transparent runs. each row is represented by a sequence of runs whose lengths add up to the image width. rows are encoded starting with the top row and progressing toward the bottom row. ๐
โญ Bitonal RLE format โญ
the Bitonal RLE format is a simple run-length encoding scheme for bitonal images.
the data always begin with a text header composed of the two characters "R4", the number of columns, and the number of rows. all numbers are expressed in decimal ASCII. these three items are separated by blank characters (space, tab, carriage return, or linefeed) or by comment lines introduced by character "#". the last number is followed by exactly one character which usually is a linefeed character. โจ
the rest of the file encodes a sequence of numbers representing the lengths of alternating runs of transparent and black pixels. lines are encoded starting with the top line and progressing toward the bottom line. each line starts with a white run. the decoder knows a line is finished when the sum of the run lengths for that line is equal to the number of columns in the image. ๐ซถ
- numbers in range
0to191are represented by a single byte in range0x00to0xbf. - numbers in range
192to16383are represented by a two byte sequence: the first byte, in range0xc0to0xff, encodes the six most significant bits of the number; the second byte encodes the remaining eight bits of the number.
this scheme allows for runs of length zero, which are useful when a line starts with a black pixel, and when a very long run (whose length exceeds 16383) must be split into smaller runs. ๐
๐ง Portable Pixmap (PPM) format ๐ง
the Portable Pixmap format is a well known format for representing color images. check the ppm(1) man page for complete information. ๐
the data always begin with a text header composed of the two characters "P6", the number of columns, the number of rows, and the maximal value of a color component (usually 255). all numbers are expressed in decimal ASCII. these three items are separated by blank characters (space, tab, carriage return, or linefeed) or by comment lines introduced by character "#". the last number is followed by exactly one character which usually is a linefeed character. โจ
the rest of the file encodes all the pixels. each pixel is represented by three bytes representing the red, green and blue component of the pixel. pixels are ordered in left to right, top to bottom. ๐
๐ Comments in separated files ๐
each page is followed by an arbitrary number of comment lines starting with character "#" and terminated by a linefeed character. certain comment lines have special meanings. ๐จ
in the following constructs, all the strings are UTF-8 encoded and represent in the style of Postscript strings, that is, surrounded with parenthesis and using C-style escape sequences introduced by a backslash.
# T px:py dx:dy wxh+x+y (string)such a comment line indicates that the piece of text string must be associated with an area of size wxh at position x,y relative to the lower left corner of the page. integers px, and py represent the position of the current point on the text baseline before the text was drawn. the drawing operation then moves the current point by dx, and dy pixels. when such comments are present,csepdjvuproduces a hidden text layer for the corresponding pages. ๐# L wxh+x+y (url)such a comment line indicates that a hyperlink to url url should be associated with area of size wxh at position x,y. when such comments are present,csepdjvuproduces pages with an annotation chunk containing the specified hyperlinks. ๐# B count (string) (#pageno)such a comment line provides outline information for the document. an outline entry entitled string is associated with page pageno. integer count indicates how many of the following outline entries must be attached to the current entry as subentries. when such comments are present in the first pagecsepdjvuproduces an navigation chunk with the specified outline. ๐๏ธ# P (string)such a comment line provides a title string for the current page. ๐ท๏ธ
๐ CREDITS ๐
this program was initially written by Lรฉon Bottou <leonb@users.sourceforge.net> and was improved by Bill Riemers <docbill@sourceforge.net> and many others. absolute icons, fr fr. ๐โจ
๐ SEE ALSO ๐
okay bestie that's the whole thing, go forth and encode ๐ ๐ฆ๐ธ โ this was brought to you by DjVuLibre-3.5, dated 10/11/2001, periodt. ๐
๐ฆ where this page comes from
- alpine 3.24: djvulibre-doc 3.5.30-r0 ยท GPL-2.0-only
- arch rolling: djvulibre 3.5.30.1-1 ยท GPL-2.0-or-later
- debian bookworm: djvulibre-bin 3.5.28-2.1~deb12u1
- debian bookworm: djvulibre-bin 3.5.28-2.2~deb12u1
- debian trixie: djvulibre-bin 3.5.28-2.2
- epel 10: djvulibre 3.5.28-13.el10_0 ยท GPL-2.0-or-later
- epel 9: djvulibre 3.5.28-4.el9 ยท GPLv2+
- fedora 43: djvulibre 3.5.28-14.fc43 ยท GPL-2.0-or-later
- fedora 43: djvulibre 3.5.30-1.fc43 ยท GPL-2.0-or-later
- fedora 44: djvulibre 3.5.28-16.fc44 ยท GPL-2.0-or-later
- fedora 44: djvulibre 3.5.30-1.fc44 ยท GPL-2.0-or-later
- nixos 26.05: djvulibre 3.5.29
- nixpkgs unstable: djvulibre 3.5.30
- opensuse-leap 16.0: djvulibre 3.5.28-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: djvulibre 3.5.28-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: djvulibre 3.5.28-160000.2.2 ยท GPL-2.0-or-later
- opensuse-leap 16.0: djvulibre 3.5.28-160000.2.2 ยท GPL-2.0-or-later
- ubuntu jammy: djvulibre-bin 3.5.28-2build2
- ubuntu jammy: djvulibre-bin 3.5.28-2ubuntu0.22.04.2
- ubuntu noble: djvulibre-bin 3.5.28-2build4
- ubuntu noble: djvulibre-bin 3.5.28-2ubuntu0.24.04.2
- ubuntu questing: djvulibre-bin 3.5.28-2.2
- ubuntu resolute: djvulibre-bin 3.5.29-1
- ubuntu stonking: djvulibre-bin 3.5.30-1
- Copyright (c) 2001-2003 Leon Bottou, Yann Le Cun, Patrick Haffner
- Copyright (c) 2001 AT&T Corp., and Lizardtech, Inc
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms