hpjansson/chafa logo

hpjansson/chafa

Free

📺🗿 Terminal graphics for the 21st century.

FreeFree tier
Type
Open Source

About hpjansson/chafa

Chafa is a command-line utility that converts image data, including animated GIFs, into ANSI/Unicode character art or graphics formats (such as Sixel, iTerm2, and Kitty) suitable for display in a terminal. It supports a wide range of image formats via optional libraries (JPEG, PNG, TIFF, WebP, SVG) and works across many terminal types, from historical teleprinters to modern emulators. The core functionality is provided by a C library with a well-documented public API, and official Python and JavaScript bindings are available. Chafa is free and open-source under LGPLv3+.

Key Features

Converts images and animated GIFs to ANSI/Unicode character art
Outputs to terminal graphics formats: Sixel, iTerm2, Kitty
Supports input formats: JPEG, PNG, GIF, TIFF, WebP, SVG (via optional libraries)
Broad terminal compatibility, from teleprinters to modern emulators
Core functionality provided by a C library with public, well-documented API
Python bindings maintained by Erica Ferrua Edwardsdóttir
JavaScript/WebAssembly bindings maintained by Héctor Molinero Fernández
Free and open-source (LGPLv3+)

Pros & Cons

Pros
  • Free and open-source (LGPLv3+)
  • Lightweight and fast command-line tool
  • Supports a wide variety of image formats and output modes
  • Works across virtually all terminal types and environments
  • Well-maintained with official bindings for Python and JavaScript
  • Active development with regular releases (33 releases as of latest)
Cons
  • Command-line only; no graphical user interface
  • May require compiling from source on some systems if not packaged
  • Relies on external libraries for advanced image format support (JPEG, SVG, etc.)
  • Limited to terminal display; no native image preview outside terminal

Best For

Display images directly in a terminal without a graphical environmentGenerate ANSI art for terminal-based applications or gamesConvert image sequences (including animated GIFs) for terminal playbackIntegrate image rendering into CLI tools or terminal multiplexersUse as a library to add terminal graphics support to other applications

FAQ

What is Chafa?
Chafa is a command-line utility that converts image data, including animated GIFs, into ANSI/Unicode character art or terminal graphics formats (Sixel, iTerm2, Kitty). It is designed to work across a wide range of terminals, from historical teleprinters to modern emulators.
How do I install Chafa?
Chafa is packaged for many distributions. For the latest version, you can clone the git repository and build from source using Autoconf, Automake, and Libtool, with dependencies including GLib, FreeType2, and optionally libjpeg, librsvg, libtiff, and libwebp.
Are there language bindings for Chafa?
Yes, there are official Python bindings maintained by Erica Ferrua Edwardsdóttir and JavaScript/WebAssembly bindings maintained by Héctor Molinero Fernández, available from NPM and usable in Node.js and web browsers.