Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE>Asciitopgm User Manual</TITLE></HEAD>
<BODY>
<H1>asciitopgm</H1>
Updated: 20 January 2011
<BR>

<A HREF="#index">Table Of Contents</A>

<H2>NAME</H2>
asciitopgm - convert ASCII graphics into a PGM

<H2 id="synopsis">SYNOPSIS</H2>

<B>asciitopgm</B>
[<b>-d</b> <i>divisor</I>] <I>height</i> <i>width</I> [<I>asciifile</I>]

<H2 id="description">DESCRIPTION</H2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><B>asciitopgm</b> reads ASCII data as input and produces a PGM image
with pixel values which are an approximation of the
"brightness" of the ASCII characters, assuming
black-on-white printing.  In other words, a capital M is very dark, a
period is very light, and a space is white.

<p>Obviously, <b>asciitopgm</b> assumes a certain font in assigning
a brightness value to a character.

<p><b>asciitopgm</b> considers ASCII control characters to be all white.  For
a lower case character, It assigns a special brightnesses which has nothing to
do with what it looks like printed.
<b>asciitopgm</b> takes the ASCII character code from the lower 7 bits
of each input byte.  But it warns you if the most significant bit of
any input byte is not zero.

<p>The output image is <i>height</i> pixels high by <i>width</i> pixels wide,
truncating and padding with white on the right and bottom as necessary.

<P>The <i>divisor</I> value is an integer (decimal) by which the
blackness of an input character is divided; the default value is 1.
You can use this to adjust the brightness of the output: for example,
if the image is too bright, increase the divisor.

<p>In a sort of reminiscence of Fortran line printer carriage control,
where a line starts with <b>+</b> (plus), <b>asciitopgm</b> combines it
with the previous row of output instead of generating a new row.  This
allows a larger range of gray values.  (In Fortran carriage control, the
first character of every line sent to the printer tells how much to advance
the paper, with <b>+</b> meaning not at all, so that the rest of the
characters on the line overstrike the ones already on the paper.  What
<b>asciitopgm</b> does is rather different in that <b>asciitopgm</b> does not
reserve the first character of every line that way.  If the first character is
anything but <b>+</b>, <b>asciitopgm</b> considers it just to be first
character of the image.

<P>If you're looking for something that creates an image of text,
with that text specified in ASCII, that is something quite different.
Use <b>pbmtext</b> for that.

<H2 id="seealso">SEE ALSO</H2>

<A HREF="pbmtoascii.html">pbmtoascii</A>,
<A HREF="pbmtext.html">pbmtext</A>,
<A HREF="pgm.html">pgm</A>

<H2 id="author">AUTHOR</H2>

Wilson H. Bent. Jr. (<A HREF="mailto:whb@usc.edu">whb@usc.edu</A>)

<HR>
<A NAME="index">&nbsp;</A><H2>Table Of Contents</H2>
<UL>
<LI><A HREF="#synopsis">SYNOPSIS</A>
<LI><A HREF="#description">DESCRIPTION</A>
<LI><A HREF="#seealso">SEE ALSO</A>
<LI><A HREF="#author">AUTHOR</A>
</UL>
</BODY>
</HTML>