man > pbmtoascii(1)

TLDR: pbmtoascii (tldr-pages)

Convert a PBM image to ASCII graphics.

  • Read a PBM file as input and produce an ASCII output
    pbmtoascii {{path/to/input_file.pbm}}
  • Read a PBM file as input and save an ASCII output into a file
    pbmtoascii {{path/to/input_file.pbm}} > {{path/to/output_file}}
  • Read a PBM file as input while setting the pixel mapping (defaults to 1x2)
    pbmtoascii -{{1x2|2x4}} {{path/to/input_file.pbm}}
  • Display version
    pbmtoascii {{-v|-version}}
Pbmtoascii User Manual(1)              General Commands Manual             Pbmtoascii User Manual(1)

NAME
       pbmtoascii - convert a PBM image to ASCII graphics


SYNOPSIS
       pbmtoascii

       [-1x2|-2x4]

       [pbmfile]


DESCRIPTION
       This program is part of Netpbm(1).

       pbmtoascii  reads  a  PBM image as input and produces a somewhat crude ASCII graphic image as
       output.

       To convert back, use asciitopgm(1).

       ppmtoterm does a similar thing for color images to be displayed on color text terminals.



OPTIONS
       In addition to the options common to all programs based on libnetpbm  (most  notably  -quiet,
       see ]8;;index.html#commonoptions\ Common Options]8;;\ ), pbmtoascii recognizes the following command line options:

       The -1x2 and -2x4 options give you two alternate ways for the pixels to get mapped to charac‐
       ters.  With 1x2, the default, each character represents a group of 1 pixel across by 2 pixels
       down.   With  -2x4, each character represents 2 pixels across by 4 pixels down.  With the 1x2
       mode you can see the individual pixels, so it's useful for previewing small images on a  non-
       graphics  terminal.   The  2x4 mode lets you display larger images on a small display, but it
       obscures pixel-level details.  2x4 mode is also good for displaying PGM images:

       pamscale -width 158 | pnmnorm | pamditherbw -threshold | pbmtoascii -2x4


       should give good results.


SEE ALSO
       asciitopgm(1) ppmtoascii(1) ppmtoterm(1) pbm(1)


AUTHOR
       Copyright (C) 1988, 1992 by Jef Poskanzer.

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/pbmtoascii.html

netpbm documentation                        02 April 2010                  Pbmtoascii User Manual(1)

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-04 10:18 @216.73.216.46
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!