man > ppmtoterm(1)

TLDR: ppmtoterm (tldr-pages)

Convert a PPM image to an ANSI ISO 6429 ASCII image.

  • Convert a PPM image to an ANSI ISO 6429 ASCII image, mapping each pixel to an individual character
    ppmtoterm {{path/to/input.ppm}} > {{path/to/output.txt}}
Ppmtoterm User Manual(1)               General Commands Manual              Ppmtoterm User Manual(1)

NAME
       ppmtoterm - convert a PPM image to a ANSI ISO 6429 ascii image


SYNOPSIS
       ppmtoterm

       [ppmfile]

       All  options can be abbreviated to their shortest unique prefix.  You may use two hyphens in‐
       stead of one.  You may separate an option name and its value with white space instead  of  an
       equals sign.


DESCRIPTION
       This program is part of Netpbm(1).

       This  program  tries to produce an accurate representation of a PPM image on an terminal that
       implements the ANSI ISO 6429 standard.  It approximates colors, finding the minimum Cartesian
       distance between the input RGB vectors and the ones in the generated palette.  As the  avail‐
       able  color  palette  is somewhat restricted, you get the best results when the colors in the
       original image are few and the RGB intensities are close to zero, half of maximum, and  maxi‐
       mum.

       You  can  usually  get good results with cartoons or images with plain colors (no gradients).
       With photos, results can vary, but are usually not very accurate.

       The output image has one line for each row and one character for each column of the input im‐
       age.  E.g. an 80 pixel by 25 pixel PPM image would fill up an  80x25  terminal  screen.   Use
       pamscale or pamcut to make your image fit properly on your screen.

       Furthermore, use pamscale to recover the proper aspect ratio, because a character on a termi‐
       nal  screen  is rarely square.  Typically, a character is twice has high as it is wide, so in
       order for a 20x20 image to appear square on your terminal,  as  it  should,  you'll  want  to
       squash it vertically or stretch it horizontally by a factor of two (resulting int 10x20 char‐
       acters are 20x40 characters).

       The  image starts at the current cursor position on the terminal screen.  Each successive row
       starts at Column 0 on the screen.  If you want to shift the image up or down, for example  to
       center it, use pnmpad on the input.

       This  program  was  born with the objective of displaying nice color images on the Linux con‐
       sole, e.g. a proper logo at Linux boot.

       ppmtoascii does a similar things, but combines 2 or 8 pixels into one  character,  where  the
       character roughly represents those particular pixels, whereas ppmtoterm displays each charac‐
       ter of the image as a single pixel.

       pbmto4425  does a similar thing for black and white images, using line drawing characters, on
       some terminals.


OPTIONS
       There are no command line options defined specifically for ppmtoterm, but it  recognizes  the
       options common to all programs based on libnetpbm (See ]8;;index.html#commonoptions\ Common Options]8;;\ .)


SEE ALSO
       pamscale(1), pamcut(1), ppmtoascii(1), pbmtoascii(1), pbmto4425(1), ppm(1)



AUTHOR
       Copyright (C) 2002 by Ero Carrera.



HISTORY
       This program was new in Netpbm 10.9 (August 2002).

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

netpbm documentation                        17 June 2017                    Ppmtoterm User Manual(1)

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