ASCIITOPGM(1)
π¦ okay so this is the Asciitopgm User Manual(1), from the General Commands Manual section π¦
no cap, bestie, this one is a whole vibe β it's a little time machine back to when people made pictures out of letters. let's get into it π
β¨ NAME β¨
asciitopgm β convert ASCII graphics into a PGM π
β¨ SYNOPSIS β¨
asciitopgm
[-divisor=integer]
height width [asciifile]
okay quick notes because this trips people up every single time:
- the minimum unique abbreviation of an option is acceptable β you don't gotta type the whole thing, just enough that it's the only one it could be πΈ
- you can use double hyphens instead of single hyphen to denote options. both work, she's flexible π
- you can also use white space in place of the equals sign to separate an option name from its value. iconic, honestly π«Ά
β¨ DESCRIPTION β¨
so this program is part of Netpbm(1) β you knew that, but like, now you know it π
asciitopgm converts a text grayscale image to PGM. and what's a text grayscale image, you ask? okay so it's this thing people did back in the early days β they generated a grayscale graphical image with a black on white text printer. every single character printed is one pixel. a big chunky character like a capital M is a dark pixel, and a tiny little character like a period is a light pixel. a space is a fully white pixel. then the viewer stands, like, so far back from the printed page that their eyes blur all the text together and they see a grayscale image π§β¨
the classic novelty use? printing out a photograph of a person's face in text. main character energy, truly π
obviously, asciitopgm assumes a certain font when it assigns a brightness value to a character. it's not out here doing font detection, bestie, it just commits π
here's the tea on how it reads your input:
asciitopgmconsiders 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 brightness which has nothing to do with what it looks like printed. yeah. it said what it said π
asciitopgmtakes 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 π
the output image is height pixels high by width pixels wide, truncating and padding with white on the right and bottom as necessary. so it always fits, she makes it work π
π the Fortran carriage control thing (iykyk) π
okay this part is so niche and I'm obsessed with it. in a sort of reminiscence of Fortran line printer carriage control β where a line starts with + (plus) β asciitopgm combines it with the previous row of output instead of generating a new row. why? because it allows a larger range of gray values β¨
for context, in Fortran carriage control, the first character of every line sent to the printer tells how much to advance the paper, with + meaning not at all, so that the rest of the characters on the line overstrike the ones already on the paper π
but β and this is important, bestie β what asciitopgm does is rather different, in that asciitopgm does not reserve the first character of every line that way. if the first character is anything but +, asciitopgm considers it just to be the first character of the image. periodt. π
the maxval of the output image is 127. noted, remember it, it's on the test π
β hold up β if you're looking for something that creates an image of text, with that text specified in ASCII, that is something quite different. usepbmtextfor that. don't come forasciitopgm, she does a different job π«Ά
β¨ OPTIONS β¨
in addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), asciitopgm recognizes the following command line option:
-divisor=integerβ specify the value by which the blackness of an input character is divided. it's an integer value. larger values produce brighter output images β¨
a few things about this one:
- the value must be positive β
- the default value is
1 - you can use this to adjust the brightness of the output: for example, if the image is too dark, increase the divisor π
π history lesson: before Netpbm 11.14 (March 2006), this option must be abbreviated -d, separated from its value by a space and not an equals sign, and appear before the non-option arguments. the way the old syntax was gatekeptβ¦ we don't miss her.
β¨ SEE ALSO β¨
pbmtoascii(1)pbmtext(1)pgm(1)
β¨ AUTHOR β¨
Wilson H. Bent. Jr. (whb@usc.edu) β thank you king, we appreciate you π
β¨ DOCUMENT SOURCE β¨
this manual page was generated by the Netpbm tool makeman from HTML source. the master documentation is at:
http://netpbm.sourceforge.net/doc/asciitopgm.html
and that's the whole thing, bestie π this came to you from the netpbm documentation crew, dated 15 January 2026 β go forth and turn your letters into pixels, you absolute icon πβ¨π¦π
π¦ where this page comes from
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms