CPALDJVU(1)
π CPALDJVU β bestie's guide to the DjVu low-color encoder π
okay so this is cpaldjvu, part of DjVuLibre-3.5, and she's here to turn your cute little low-color images into DjVu documents. pull up a chair π«Ά
β¨ NAME β¨
cpaldjvu β DjVuDocument encoder for low-color images. that's it, that's the girl π
β¨ SYNOPSIS β¨
cpaldjvu [options] inputppmfile outputdjvufile
β¨ DESCRIPTION β¨
so cpaldjvu is a DjVuDocument encoder built for images that only have, like, a few colors. it literally eats those for breakfast π
it's at its absolute best on images with big solid color areas β think screen dumps, screenshots, that kind of thing. and the compression ratios on those? SO much higher than what GIF or PNG can do. not even close. iconic behavior honestly π
here's the tea on how it works, step by step:
- first it reduces the number of distinct colors down to a small value you specify, using a simple color quantization algorithm.
- then it takes the dominant color and encodes it into the background layer.
- and all the other colors? they get encoded into the foreground layer.
periodt. that's the whole strategy π
β¨ OPTIONS β¨
-dpi nβ sets the resolution info that gets baked into the output file, measured in dots per inch. why does this matter? because the resolution encoded in DjVu files is literally what tells the decoder how to scale the image on a particular display. meaningful values range from25to6000. default is300dpi. π-colors nβ sets the maximum number of distinct colors the color quantization algorithm is allowed to use. default is256. ngl, smaller values can produce much smaller files, so if size is your main character moment, go lower π-bgwhiteβ makes the background layer use the lightest quantified color instead of the dominant color. little switch-up, big difference β¨-verboseβ shows informational messages while it's running, so you can watch her work. obsessed π
β¨ REMARKS β¨
β οΈ heads up bestie: the color quantization might introduce severe degradation if your image has photographic areas with a huge number of very similar colors. like, it can get rough. π
if you're hitting quantization problems, the move is to pre-process the input file with a different quantization program instead β something like ppmquant. that can fix it π«Ά
and one more thing: avoid the error diffusion dithering algorithm. do not do it. it generates random dithering patterns that might be very costly to encode. it's giving expensive for no reason π
β¨ BUGS β¨
real talk: this program should be rewritten as a pre-processor for csepdjvu. that's the honest truth, we're just saying it π
β¨ CREDITS β¨
this program was initially written by LΓ©on Bottou <leonb@users.sourceforge.net> and was improved by Bill Riemers <docbill@sourceforge.net> β plus many others. legends only πβ¨
β¨ SEE ALSO β¨
djvu(1), pbm(5), ppmquant(1), pnmtogif(1), pnmtopng(1) β go read those too, iykyk ππ
and that's the whole page, bestie! this one's from DjVuLibre-3.5, dated 10/11/2001, and it lives under the name CPALDJVU(1) in the manual. slay, go compress something ππ¦πΈ
π¦ 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