Tuesday, August 22, 2006

qualita doppia con djvumake

La qualita migliora sempre ecco come fare un djvu con foreground a 300dpi e background a 100 dpi (invece dei 50 di default) la qualita incrementa in modo notevole, anche le dimensioni purtoppo.


ermanno@localhost ~/.aMule/Incoming/work/dj $ for i in myfile*; do jpegtopnm $i|pamditherbw -threshold -value 0.85|pamtopnm>mask.pbm; cjb2 -lossy -clean mask.pbm mask.djvu; pnminvert mask.pbm>maskinv.pbm; c44 -dpi 100 $i -mask mask.pbm back.djvu; c44 -dpi 300 $i -mask maskinv.pbm fore.djvu; djvuextract back.djvu BG44=back.iw44; djvuextract fore.djvu BG44=fore.iw44; djvumake $i.djvu Sjbz=mask.djvu FG44=fore.iw44 BG44=back.iw44; done

I made a new version of the script this time the foreground is reduced 4 times and the background 2 times, this makes sense, I found out by myself that the previous script was crap becouse foreground and background were encoded at the same resolution ... It would be nice to have an option to djvumake to control the encoding of PPM=file ...

for i in ../myfile*.jpg; do jpegtopnm $i>temp.pnm; pamditherbw -threshold -value 0.85 temp.pnm|pamtopnm>mask.pbm; cjb2 -lossy -clean mask.pbm mask.djvu; pamscale -reduce 2 temp.pnm>temp2.pnm; pamscale -reduce 2 mask.pbm>mask2.pbm; pamscale -reduce 2 temp2.pnm>temp3.pnm; pamscale -reduce 2 mask2.pbm>mask3.pbm; pnminvert mask3.pbm>maskinvert.pbm; c44 -mask mask2.pbm temp2.pnm back.djvu; c44 -slice 100 -mask maskinvert.pbm temp3.pnm fore.djvu; djvuextract back.djvu BG44=back.iw44; djvuextract fore.djvu BG44=fore.iw44; djvumake test.djvu Sjbz=mask.djvu FG44=fore.iw44 BG44=back.iw44;done

0 Comments:

Post a Comment

<< Home