Workflow · DjVu Ebooks
How to Create DjVu Ebooks from ScanTailor Output
DjVu was designed specifically for scanned documents, and it is still one of the most compact ways to publish a scanned book. ScanTailor Advanced prepares the pages; a DjVu encoder — this guide uses the open-source DjVuLibre tools — turns them into a single DjVu document. ScanTailor itself does not assemble DjVu files, just as it does not perform OCR.
Why DjVu suits scanned books
Most document formats treat a scanned page as one flat picture. DjVu does something smarter: according to the DjVuLibre project, a DjVu document separates a page into a foreground layer — the text and line drawings, encoded with a bitonal method (JB2) that excels at repeated shapes like letters — and a background layer for pictures and paper texture, encoded with a wavelet method (DjVuPhoto/IW44). Each layer gets the compression that fits it, which is why DjVu has long been favored by digital libraries and scanned-book archives. A searchable text layer produced by OCR can also be stored inside the DjVu file, compressed alongside the pages.
The practical consequences for a book scanner: pages with a mix of dense text and illustrations stay compact without smearing either, pages turn and zoom quickly even in large documents, and the text remains sharp at reading sizes. The trade-off is ecosystem: DjVu readers are less common than PDF readers, so DjVu works best when you control the reading setup, or as the compact archival/distribution format alongside your masters.
Step 1: Prepare pages in ScanTailor
Run the normal pipeline — orientation, split pages, deskew, content selection, page layout, and dewarping where the spine curve needs it. DjVu encoding rewards exactly what ScanTailor produces: uniformly sized, straight pages with consistent margins. Two output decisions matter most:
Match the output mode to the page
Black-and-white output for plain text pages encodes beautifully with DjVu’s bitonal method and produces the smallest files. Mixed output — where ScanTailor keeps picture zones in color or grayscale while binarizing the text — maps naturally onto DjVu’s foreground/background separation, and is the classic route for illustrated books, manuals with photographs, and pages with stamps or colored annotations. Use plain color/grayscale output when the page’s appearance itself is the content, accepting larger files.
Be conservative with thresholds
Binarization is final. A threshold that nibbles the edges of letters will be faithfully preserved by the encoder. Check a few dense pages at full size before running the whole book through the batch workflow; our threshold methods guide explains the trade-offs of each method.
Keep the TIFFs. DjVu encoding is lossy for color content and one-way for binarized content. Your ScanTailor output pages are the masters — archive them separately (see the OCR workflow for the masters habit) and treat the DjVu file as a reading copy.
Step 2: Encode with DjVuLibre
DjVuLibre is the open-source (GPL) implementation of DjVu, maintained by the format’s original inventors, and current releases are still published (version 3.5.30 at the time of writing). It ships command-line encoders and utilities rather than a one-click converter, and the workflow is:
- Encode each page. The DjVuLibre toolset includes cjb2, the encoder for bitonal (black-and-white) pages, and c44, the wavelet encoder for color and photographic pages — pick per page type, matching the ScanTailor output mode you chose. Palettized pages have their own encoder (cpaldjvu).
- Assemble the book. The djvm utility combines the per-page DjVu files into a single multi-page document and manages page order.
- Add text, if you have it. If you ran OCR on the pages (see the ScanTailor-to-OCR workflow), DjVu can carry a text layer so the book is searchable; DjVuLibre’s utilities can inspect and manipulate that layer. If you skipped OCR, the DjVu is an image-only book — still perfectly readable, just not searchable.
Exact options for each tool are documented in its manual page, which ships with DjVuLibre — encoder quality and resolution settings are worth a small test on two or three representative pages (one text-dense, one illustrated) before committing a whole book to one setting.
Step 3: Read and check the result
DjVuLibre itself includes a standalone viewer (DjView), and DjVu files can also be opened by a range of third-party readers and library software; some ebook managers can convert or send them to reading devices. Whatever you read with, do the same spot checks you would for any derived format: page order, a dense text page at reading zoom, an illustrated page for color banding, and — if you added one — a text search for a word you know is on a specific page. If a check fails, the fix almost always belongs one step earlier: re-encode from the kept masters with adjusted settings, rather than patching the DjVu.
DjVu or PDF? Choose DjVu when compact size and scanned-book handling matter most and your readers are covered; choose PDF when the file must open everywhere with no extra software. The two are not rivals in a good archive — many digitizers keep TIFF masters plus a DjVu reading copy, and build a searchable PDF when they need to share with the wider world.
Frequently Asked Questions
Can ScanTailor create DjVu files directly?
No. Assembling multi-page documents is outside ScanTailor’s scope; it outputs cleaned page images. Encoding those pages into a DjVu document is a separate step done with an encoder such as the open-source DjVuLibre tools.
Which ScanTailor output mode is best for DjVu?
Black-and-white output for plain text pages pairs with DjVu’s bitonal encoding for the smallest files. Mixed output suits illustrated books because it mirrors DjVu’s own separation of text (foreground) and pictures (background). Full color output works too, at larger file sizes.
Can a DjVu ebook be searchable?
Yes. DjVu documents can store an OCR text layer alongside the page images. Run OCR on the ScanTailor-cleaned pages first, then build the DjVu with that text included; without the OCR step the DjVu is image-only — readable, but not searchable.
