How to Convert Images to ASCII Art in Linux Terminal with Artem

This article shows how to create ASCII art by converting images in the Linux command line with the Artem app.

Every Linux enthusiast spends a significant amount of time on the command line. This time, however, we’ll look at one of the most fun parts of the Linux terminal: creating ASCII art from images.

These can be used for various purposes, for example, in SSH warning banners and welcome messages.

This is where Artem comes into the picture. Artem is a small Rust command-line tool that converts photos to ASCII art. It uses the image-rs library to read images from various image formats like PNG, JPG, GIF, WEBP, etc.

Artem tries to use truecolor by default, but if the terminal does not support truecolor, it falls back to 16 Color ANSI. However, no colors are used when an ASCII image is saved to a file.

So let me demonstrate what you can accomplish with this application.

Convert Images to ASCII with Artem on Linux

Convert Images to ASCII in Linux Using Artem

In its simplest form, Artem’s use is perfectly straightforward. The command takes an image and returns it as an ASCII art string. For example:

artem tux.jpgCode language: CSS (css)

On top of that, Artem has a lot to offer anyone seeking more options than simple functionality. For example, you can utilize custom ASCII characters while generating the image.

Add the --characters option to your command to accomplish this. In addition, keep in mind that the characters should be arranged in ascending order of darkness/density.

artem tux.jpg --characters "0123456789"Code language: JavaScript (javascript)

Another useful feature of the application is the ability to resize the generated ASCI art. The scale here ranges from 20 to 230, with 100 being the default value.

Add the --size option to your command to use this feature.

artem tux.jpg --size 120Code language: CSS (css)

The --outline flag filters the specified input image to only contain an outline, which is subsequently transformed. Please keep in mind that this may not function perfectly on every image. So, select an image with a clear separation between the background and the foreground for the best results.

In addition, you may also add the --centerX and --centerY options to center the result in your terminal if necessary.

artem tux.jpg --outline --centerXCode language: CSS (css)
Convert Images to outlined ASCII with Artem on Linux

Finally, Artem provides the option to save created ASCI pictures to files. Include the --output option in your command to achieve this.

artem tux.jpg --output myfile.txt
artem tux.jpg --output myfile.html
artem tux.jpg --output myfile.ansCode language: CSS (css)

Of course, this does not exhaust all of the application’s capabilities. For example, Artem also allows you to automatically download and convert an image from the web by using the URL address.

Visit the GitHub project website to learn more about all the options for converting an image to ASCII in the Linux terminal using Artem.

Installation

Users of Debian and all Debian-based distros like Ubuntu, Linux Mint, etc., can install Artem by downloading the most recent version of the installation .deb file and installing it locally using the apt command.

sudo apt install ./Downloads/artem_1.1.3_amd64.deb
Installing Artem image to ASCII convertor on Ubuntu

Arch Linux users can find the application in the distribution’s AUR repository. To install it, they need to execute:

yay -S artem-bin

Other Linux users who want to use this excellent image to ASCII converter must get the application source code and manually compile it for their Linux distro.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%

Leave a Reply

Your email address will not be published. Required fields are marked *