www-frontend, pbm conversion

Gert Doering (gert@greenie.muc.de)
Fri, 9 Apr 1999 08:53:16 +0200


Hi,

On Thu, Apr 08, 1999 at 08:11:19PM +0200, Marco Zietz wrote:
> > > I am trying to setup the www-frontend inlcuded in mgetty-1.1.20. I have
> > > some problems with the netpbm-tools (release 7, dec 1993) came with my
> > > suse5.3. Mgetty itself is working fine. But if I want to view a fax with
> > > scaling I only get an empty gif-file in the webtmp-dir. I found out,
> > > that the pnmscale (promoting PBM to PGM!!) outputfile is P5, but all
> > > other programs involved in this conversion need P2 files!
> >
> > P5 should be fine (that's just "greyscale").

Actually, P2 is "greyscale in ASCII", and P5 is "raw output format".

[..]
> Thanx Gert! Was a good hint! First I used your simplequant.pl amd it complained
> about the P5-input. 

Yep, simplequant doesn't like P5, it wants Ascii.

> So I tried the others you suggested in wwwgui.conf (I changed
> the path before! ;-)), but all didn't work.
> 
> Now I have written a small script for converting, yours as base, which does its
> job well. The commands are:
> 
> g3topbm <file.g3 >outfile1.pbm
> pnmscale -xscale 0.45 -yscale 0.45 <outfile1.pbm >outfile2.pgm
> ppmquant 2 <outfile2.pgm >outfile3.pgm
> ppmquant -map mapfile outfile3.pgm >outfile4.pgm
> ppmtogif <outfile4.pgm >outfile5.gif
> 
> If you look to line 3 you can see the reason. ppmquant wants the number of colors
> or a mapfile!

Well, that should not be a problem - wwwgui.conf can contain command line 
arguments for the programs, so just specify $pnmquant = "ppmquant 256"
there, and everything should work without modifying nph*cgi.

> I also made a mapfile to get real black and white and not 2 grayscales.

The results will be significantly better if you scale to 256 grayscales,
because that way you get the benefits of anti-aliasing.  GIF is 256 colors
anyway, so going to b/w only won't gain much.

gert
-- 
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-35655025                        gert.doering@physik.tu-muenchen.de