The (n+1)st standard for displaying images on the terminal

13cacb9 Minor improvements

2 years ago

9a18a06 Add width and height argument + usage string

2 years ago


Main project page

#The (n+1)st standard for terminal images

This is an attempt to create a universal tool for displaying images on the terminal. imgt will try to automatically detect and use an appropriate backend.

Development will probably be slow because I'm really bad at C. Also, just in general, terminals are a huge mess: some ignore unknown escape sequences while others don't. imgt has been tested with a number of terminals and most work well (or die gracefully), but don't be surprised if your favourite terminal spits out garbage.

The plan is to have two modes: print mode and server mode.

Print mode:

This is now obsolete thanks to Chafa's support for Kitty and sixel

  • Print out an image and exit immediately
  • Printed image will stay until the terminal is cleared
  • Images can scroll together with text
  • Stretched, cropped, and centered modes (TODO)

Supported backends:

Backend Supported terminals Supported formats Works over SSH?
Terminology Terminology Loads, even videos and GIFs Maybe (not implemented)
kitty terminal graphics Kitty PNG (others will come later) ✅ Yes (not implemented)
Truecolor RGB text + Unicode half-blocks ▄ It's complicated... Anything supported by GdkPixbuf ✅ Yes

Planned: sixel, iTerm2, other formats for Kitty

Image server mode:

  • Think Ueberzug
  • imgt starts and waits for commands on standard input
  • Commands allow for adding, deleting or moving images
  • Images may or may not scroll together with text
  • Images may or may not disappear when imgt exits, or when terminal is cleared

Supported backends: none

Planned: Kitty terminal graphics, ueberzug, w3mimgdisplay


git clone https://git.sr.ht/~gardenapple/imgt
cd imgt
gcc *.c $(< compile-flags.txt) -o imgt