Skip to content
Image to Ascii Text with color support, can output to html or ansi terminal.
HTML Python
Branch: gh-pages
Clone or download

Latest commit

Latest commit b54bf0c May 10, 2018


Type Name Latest commit message Commit time
Failed to load latest commit information.
example Fix examples Jan 13, 2016
.gitignore Add "ansi" and "graphics_util" in new arg for py_modules Aug 13, 2016
LICENSE Copyright from 2013 to 2016 now Aug 16, 2016 Minor updates on section authors Aug 16, 2016 py3.5 compat Dec 18, 2016 Add support for dithering (good for photos) Jan 13, 2016 py3.5 compat Dec 18, 2016 Bump v2.4 May 10, 2018


Image to Ascii Text, can output to html or ansi terminal.

See also gif2txt for animated version.


  1. jiaozhu.jpg > without-color.html : demo
  2. jiaozhu.jpg --dither > without-color-dither.html : demo
  3. jiaozhu.jpg --color > with-color.html: demo
  4. jiaozhu.jpg --ansi: demo


$ virtualenv venv
$ . venv/bin/activate
(venv)$ pip install


Usage: <imgfile> [--maxLen=<n>] [--fontSize=<n>] [--color] [--ansi] [--bgcolor=<#RRGGBB>] [--targetAspect=<n>] [--antialias] [--dither] (-h | --help)

  -h --help             show this screen.
  --ansi                output an ANSI rendering of the image
  --color               output a colored HTML rendering of the image.
  --antialias           causes any resizing of the image to use antialiasing
  --dither              dither the colors to web palette. Useful when converting
                        images to ANSI (which has a limited color palette)
  --fontSize=<n>        sets font size (in pixels) when outputting HTML,
                        default: 7
  --maxLen=<n>          resize image so that larger of width or height matches
                        maxLen, default: 100px
  --bgcolor=<#RRGGBB>   if specified, is blended with transparent pixels to
                        produce the output. In ansi case, if no bgcolor set, a
                        fully transparent pixel is not drawn at all, partially
                        transparent pixels drawn as if opaque
  --targetAspect=<n>    resize image to this ratio of width to height. Default is
                        1.0 (no resize). For a typical terminal where height of a
                        character is 2x its width, you might want to try 0.5 here


  • @EdRowe (#4, #7)
  • @shakib609 (#10)
  • @mattaudesse (#11)
  • @hit9



You can’t perform that action at this time.