# Chafa

> Command-line utility that converts images and animated GIFs into ANSI/Unicode character art or terminal graphics formats, built on a C library.

Stars: 5.4k · Language: C · License: LGPL-3.0 · Categories: Dev Tools

- Repository: https://github.com/hpjansson/chafa
- Website: https://hpjansson.org/chafa/
- Page: https://www.trmn.sh/tools/chafa

## Install

- Build from source: `git clone https://github.com/hpjansson/chafa.git`
- Build from source: `cd chafa`
- Build from source: `./autogen.sh`
- Build from source: `make`
- Build from source: `sudo make install`

## Overview

Chafa is a command-line utility that converts image data, including animated GIFs, into graphics formats or ANSI/Unicode character art for display in a terminal. According to the README, it supports a wide range of output targets, from historical teleprinters to current terminal emulators.

The core functionality lives in a C library with a public, documented API, and the `chafa` command-line tool is a frontend to it. Building the tool can use optional libraries for input formats: FreeType2 (required for the CLI), plus libavif, libheif (1.12 or later), libjpeg, libjxl, librsvg, libtiff and libwebp. libdeflate is optional and speeds up PNG decoding. Both library and tools are licensed under LGPLv3+.

Bindings are maintained by third parties: Python bindings by Erica Ferrua Edwardsdóttir, and JavaScript bindings by Héctor Molinero Fernández built on a WebAssembly port, available from NPM for Node.js and browsers. Likely users are developers and terminal users who want to display images or animations in a terminal, or embed the library in their own programs.

### Installation

```bash
# via Build from source
git clone https://github.com/hpjansson/chafa.git
cd chafa
./autogen.sh
make
sudo make install
```

## Alternatives

- [entr](https://www.trmn.sh/tools/entr.md): Runs arbitrary commands when files change using kqueue or inotify to avoid polling (C, 5.7k stars)
- [radare2](https://www.trmn.sh/tools/radare2.md): Command-line reverse engineering framework for disassembling, analyzing, emulating, debugging and patching binaries across many architectures and file formats. (C, 25.2k stars)
- [FFmpeg](https://www.trmn.sh/tools/ffmpeg.md): Collection of libraries and command-line tools (ffmpeg, ffplay, ffprobe) for converting, streaming, playing and inspecting audio, video and subtitles. (C, 66.0k stars)
- [freeze](https://www.trmn.sh/tools/freeze.md): Generate PNG, SVG, and WebP images of code and terminal output with syntax highlighting and customizable styling. (Go, 4.9k stars)
- [Azure CLI](https://www.trmn.sh/tools/azure-cli.md): Microsoft's cross-platform command-line interface for managing Azure resources with az group/subgroup/command syntax, JMESPath queries, and tab completion. (Python, 4.7k stars)

---

Canonical: https://www.trmn.sh/tools/chafa
