\ .\" This man page was generated by the Netpbm tool 'makeman' from HTML source. .\" Do not hand-hack it! If you have bug fixes or improvements, please find .\" the corresponding HTML page on the Netpbm website, generate a patch .\" against that, and send it to the Netpbm maintainer. .TH "Asciitopgm User Manual" 0 "15 January 2026" "netpbm documentation" .SH NAME asciitopgm - convert ASCII graphics into a PGM .UN synopsis .SH SYNOPSIS .nf \fBasciitopgm\fP [\fB-divisor=\fP\fIinteger\fP] \fIheight\fP \fIwidth\fP [\fIasciifile\fP] .fi .PP Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. .UN description .SH DESCRIPTION .PP This program is part of .BR "Netpbm" (1)\c \&. .PP \fBasciitopgm\fP converts a text grayscale image to PGM. A text grayscale image is a way that people generated a grayscale graphical image with a black on white text printer in the early days. Each character printed is one pixel. A large character such as a capital M is a dark pixel, while a small character such as a period is a light pixel. A space is a fully white pixel. The viewer stands far back from the printed page so as to blur the text and sees a grayscale image. A common novelty use of the technique was to print out a photograph of a person's face in text. .PP Obviously, \fBasciitopgm\fP assumes a certain font in assigning a brightness value to a character. .PP \fBasciitopgm\fP considers ASCII control characters to be all white (except for newline, which is never a pixel but rather indicates the end of a raster row as you would expect). For a lower case character, It assigns a special brightnesses which has nothing to do with what it looks like printed. .PP \fBasciitopgm\fP 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. .PP The output image is \fIheight\fP pixels high by \fIwidth\fP pixels wide, truncating and padding with white on the right and bottom as necessary. .PP In a sort of reminiscence of Fortran line printer carriage control, where a line starts with \fB+\fP (plus), \fBasciitopgm\fP 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 \fB+\fP meaning not at all, so that the rest of the characters on the line overstrike the ones already on the paper. What \fBasciitopgm\fP does is rather different in that \fBasciitopgm\fP does not reserve the first character of every line that way. If the first character is anything but \fB+\fP, \fBasciitopgm\fP considers it just to be the first character of the image. .PP The maxval of the output image is 127. .PP If you're looking for something that creates an image of text, with that text specified in ASCII, that is something quite different. Use \fBpbmtext\fP for that. .UN options .SH OPTIONS .PP In addition to the options common to all programs based on libnetpbm (most notably \fB-quiet\fP, see .UR index.html#commonoptions Common Options .UE \&), \fBasciitopgm\fP recognizes the following command line option: .TP \fB-divisor=\fP\fIinteger\fP Specify the value by which the blackness of an input character is divided. This is an integer value. Larger values produce brighter output images. .sp The value must be positive. .sp The default value is 1. .sp You can use this to adjust the brightness of the output: for example, if the image is too dark, increase the divisor. .sp Before Netpbm 11.14 (March 2006), this must be abbreviated \fB-d\fP, separated from its value by a space and not an equals sign, and appear before the non-option arguments. .UN seealso .SH SEE ALSO .BR "pbmtoascii" (1)\c \&, .BR "pbmtext" (1)\c \&, .BR "pgm" (1)\c \& .UN author .SH AUTHOR Wilson H. Bent. Jr. (\fIwhb@usc.edu\fP) .SH DOCUMENT SOURCE This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at .IP .B http://netpbm.sourceforge.net/doc/asciitopgm.html .PP