Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Displays images on your 256-color terminal with Unicode block characters.
C Makefile Groff
Latest commit 3f852c1 @rossy Relicense to CC0
Apparently the StrongestPL wasn't free software.
Failed to load latest commit information.
extra Remove oxytux.png.
man6 A practical revolution in cowsay technology.
COPYING Relicense to CC0
Makefile Fix Makefile for real Relicense to CC0
img2xterm.c Relicense to CC0

img2xterm: display images on the terminal

img2xterm is a program that can display bitmap images on 256-colour terminals by converting them into Unicode block characters and xterm compatible control sequences. Based on software by lachs0r and Xebec for creating colourful cowfiles, img2xterm improves on the colour selection and block printing logic, providing cleaner output on terminals with nice bitmap fonts.

This is an example of a cowfile created with img2xterm's --cow option:

Example of img2xterm in action.

img2xterm uses a modified version of the algorithm used in xterm256-conv in order to have an accurate representation of the upper 240 colours used in xterm. Modification was needed in order to fix the range of the grey ramp.


Before compilation, make sure you have development versions of ImageMagick (for MagickWand) and Ncurses (for terminfo support.)

Getting img2xterm

The GNU Autotools are not required. To compile and install from source, simply run:

$ make
# make install

A GIMP palette containing the upper 240 colours used in xterm is also available. It can be used for dithering images before conversion. To install, run:

$ cd extra/
$ make
$ cp xterm-256color.gpl ~/.gimp-2.6/palettes/

Converting images

To display an image on a compatible 256-color terminal:

$ img2xterm image.png

img2cow is a symlink to the img2xterm command. When invoked in this way, the program behaves as if the --cow option was used.

To generate a cowfile:

$ img2cow image.png image.cow
# cp image.cow /usr/share/cows

Known issues

  • There is something wrong with the implementation of CIE94 delta-E.
  • ImageMagick can be glitchy. Perhaps using libpng would be a better idea.


To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.


Something went wrong with that request. Please try again.