CJB2(1)
β¨ CJB2(1) β¨
okay bestie, welcome to section 1 of the manual, where we talk about cjb2 β the simple DjVuBitonal encoder from DjVuLibre-3.5. she's not complicated, she's just really good at her one job π
π NAME π
cjb2 β simple DjVuBitonal encoder. that's it, that's the whole identity, and she ate π₯
πΈ SYNOPSIS πΈ
cjb2 [options] inputfile outputdjvufile
π DESCRIPTION π
So basically, this is a simple encoder for bitonal files. the argument inputfile is the name of a PBM or bitonal TIFF file containing a single document image. and this program produces a DjVuBitonal file named outputdjvufile. that's the whole pipeline, no cap β¨
The default compression process is lossless: if you decode the DjVuBitonal file at full resolution, you get an image exactly identical to the input file. like, pixel for pixel, iconic behavior honestly π
Lossy compression gets switched on by options -losslevel, -lossy, or -clean. so if you want your files smol, you gotta say so π¦
π OPTIONS π
-dpi nβ specify the resolution info that gets encoded into the output file, expressed in dots per inch. the resolution info in DjVu files is what tells the decoder how to scale the image on a particular display. meaningful resolutions range from25to1200. for TIFF files the default resolution is the resolution specified by the input file. for PBM files the default resolution is300dpi. π-losslessβ make sure the encoded image is pixel-per-pixel equal to the initial image. this option is equivalent to-losslevel 0and it's the default. the safe queen, the no-notes option π-cleanβ only remove flyspecks from the input image. this option enables a heuristic algorithm that removes very small marks. such marks are often caused by noise and dust during the scanning process, which is so real of scanners honestly π. the threshold mark size is chosen according to the resolution specified with option <span>β</span> yeah the manpage literally just says "with option" and then stops, bestie, I'm not gonna invent a flag for you, that's on the original π. this option is equivalent to-losslevel 1.-lossyβ substitute patterns with small variations. in addition to the flyspeck removal heuristic, this option enables an algorithm that encodes certain characters by simply replicating the shape of a previously encoded character with a similar shape. this option is equivalent to-losslevel 100. matching shapes, main character energy, she's copying her friend's fit π-losslevel xβ specify how aggressive the lossy compression is. its argument ranges from0to200. higher values generate smaller files with more potential distortions. loss level0corresponds to lossless encoding. loss level1performs image cleaning but does not perform character substitution at all. loss level100is intended to provide a good compromise. higher loss levels provide marginally better compression at the risk of unacceptable character substitutions π so like, be careful up there.-verboseβ display informational messages while running. she's yapping (affectionately) so you know what's happening π£οΈβ¨
π¦ REMARKS π¦
Lossless encoding is competitive with that of the Lizardtech commercial encoders. we love a free queen out-performing the paid ones π«Ά
Lossy encoding has made much progress thanks to Ilya Mezhirov from the minidjvu project. this also means that the lossy encoding performance can change from version to version β so lowkey don't get attached to one exact output. when lossy compression yields inadequate results, simply revert to only using option -clean or reduce the parameter of option -losslevel. glow-down your aggressiveness, glow-up your accuracy πΈ
Two features are still missing:
- Half-tone detection. collecting small marks belonging to half-tone patterns would improve compression speed. (not here yet, we're manifesting β¨)
- Multi-page compression. matching characters on several pages would improve the compression ratios for multi-page documents. (also not here yet, also manifesting π)
π 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. the pattern matching algorithm for lossy compression was contributed by Ilya Mezhirov <ilya@mezhirov.mccme.ru>. TIFF input routines are inspired by the ones contributed by R. Keith Dennis <dennis@rkd.math.cornell.edu> and Paul Young. absolute legends, every single one of them π
π SEE ALSO π
djvu(1), pbm(5). go read those next, bestie, iykyk π
and that's the whole page, mwah π β this was DjVuLibre-3.5, dated 10/11/2001, page CJB2(1). drink water, back up your files, 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