Skip to content

Instantly share code, notes, and snippets.

@gipi
Created January 11, 2013 14:47
Show Gist options
  • Save gipi/4511195 to your computer and use it in GitHub Desktop.
Save gipi/4511195 to your computer and use it in GitHub Desktop.
Create #DJVU from #JPEG images
#!/bin/bash
# http://www.howtoforge.com/creating_djvu_documents_on_linux
DPI=300
if [ $# -lt 2 ]
then
echo "usage: $0 root"
exit 1
fi
ROOT=$1
SRC=$(ls ${ROOT}*.jpeg)
for f in ${SRC}
do
anytopnm $f | ppmtopgm | pgmtopbm -value 0.499 > $f.pbm
cjb2 -dpi $DPI $f.pbm $f.djvu
rm $f.pbm
done
djvm -c $1.djvu $(ls *jpeg.djvu)
rm $(ls *jpeg.djvu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment