Install Chafa on Ubuntu 26.04

Install Chafa on Ubuntu 26.04

Chafa is a command-line utility that converts images into terminal-friendly graphics using Unicode characters, ANSI escape sequences, and other text-based output formats. It supports a wide range of image formats and is useful for previewing images directly in a terminal session. This tutorial demonstrates how to install Chafa on Ubuntu 26.04.

Install Chafa

Update the local package index before installing new software:

sudo apt update

Install the Chafa:

sudo apt install -y chafa

Verify installation by checking the Chafa version:

chafa --version

Testing Chafa

Download a sample image for testing purposes:

curl -sSo test.png https://raw.githubusercontent.com/opencv/opencv/master/samples/data/butterfly.jpg

Display the image in the terminal using Chafa:

chafa test.png

If the command completes successfully, the terminal will render a text-based representation of the downloaded image, confirming that Chafa is working as expected.

Display image in terminal using Chafa on Ubuntu

Uninstall Chafa

If Chafa is no longer needed, remove it from the system together with packages that were installed automatically and are no longer required by using the command:

sudo apt purge --autoremove -y chafa

Leave a Comment

Cancel reply

Your email address will not be published.