The first time I saw ASCII Art, I was staring at a terminal screen on an old Linux box—someone had turned Tux the penguin into a mess of slashes, pipes, and parentheses. And yet, it was beautiful.
It felt like digital graffiti from a time before high-res displays. That single moment pulled me into the rabbit hole of turning images into text.
If you’ve ever wanted to recreate that magic, there’s a simple way to do it today—with nothing but your terminal and a tool called jp2a
. In this guide, I’ll show you exactly how to bring your images to life as ASCII Art.
Keep reading—your terminal’s about to get a whole lot more expressive.
History of jp2a
jp2a was developed by Christian Stigen Larsen and Christoph Raitzig who sought to create a straightforward utility for converting JPEG images into ASCII art. The project was inspired by the rich tradition of ASCII art, which dates back to the early days of computing when graphics were limited and text-based art flourished. The developers aimed to provide an accessible tool that retains the aesthetic qualities of original images while allowing for creative expression through ASCII.
Over the years, jp2a has gained popularity among both hobbyists and professionals in the ASCII art community. Its open-source nature has encouraged contributions and improvements, ensuring it remains a relevant and effective tool for generating ASCII art from images.
· · ─ ·𖥸· ─ · ·
Installing jp2a
To get started, you need to install jp2a on your system. Here’s how to do it for various operating systems:
On Ubuntu/Debian:
sudo apt-get update
sudo apt-get install jp2a
On macOS (using Homebrew):
brew install jp2a
On Windows:
For Windows users, installing a Linux environment via WSL (Windows Subsystem for Linux) and then following the Ubuntu instructions is recommended.
· · ─ ·𖥸· ─ · ·
Basic Usage of jp2a
Once you have installed jp2a, you can start creating ASCII art with a simple command. Here’s how to convert an image to ASCII art:
Converting an Image to ASCII Art
- Open your terminal.
- Use the following command to convert an image:
jp2a myimage.jpg
Sample Output:
.......''''.......
....,lx0KXXXKKKXXOxo:'...
...:kXX0Okkkkkkkxxxxxxxkxc'...
...oXXOkkkkkkkkxxxxxddddoooodo,...
...;XXOkkkddxxxxxxxxddddoocclllloc...
...oNxcdkk;..:xxxddddddool...;cc;,:c...
....;..;oxxdccdddddddooolllc;;ccc,.......
...;cddlc:;;;;;;;;;,,,,,,,,''''',,;:;'....
...ddc'...............................,:,...
...:c.....xO0KKKKK0d'....,xKKKKKK0Ol.....;...
..........XNWMMWMMWXK,..lXNWMWWMMWNO..........
....,....WMMK..'XMMNO..KWMMk..,WMM0....'....
...:o....MMMNc,cNMOo;..:dKMK:,oWMMK...,o'..
..;l....MMMMMMMMd.cxkkx,.KMMMMMMMK...'o'.
.....NMMMMMMMNl.:xd,.xMMMMMMMMO.....
.....XNMMMMMMMMK:',oNMMMMMMMWNk.....
.....XXXWMMMMMMMMMMMMMMMMMMNXXk....
....xXXXXNWMMMMMMMMMMMWWNXXXXl....
....lKXXXXXXXNNNNNNXXXXXXX0:...
...,clooooooooooooool:'...
................
This command will display the ASCII art representation of myimage.jpg
directly in your terminal.
Adjusting Output Width
To maintain the aspect ratio and improve readability, you can specify the width of the ASCII output:
jp2a --width=100 myimage.png
This command sets the output width to 100 characters.
Generating Colored ASCII Art
To add color to your ASCII art, use the --color
option:
jp2a --color myartwork.jpg
Sample Output (with colors):
This retains the color information from the original image, enhancing the visual appeal of your ASCII creation.
Inverting Colors
Creating high-contrast ASCII art can be achieved by inverting colors:
jp2a --invert mylogo.png
Sample Output:
-#@@@@@@@@@@@##:
+@@@@@@@%%%**%%@@@@@@@@-
-@@@@@*=-::....:...:-=+%@@@@@.
=@@@@+-..::----------------+%@@@@:
@@@%=..:--------------=========*@@@*
:@@@*..----==--------======++==++=+%@@@
:@@@=.-+=--*@@+---=========%@@*++**++%@@@
.@@@%*%%*=--=++===========+++**+++*%%%%@@@%
*@@%*+===+**************************+**%@@@=
-@@%==+%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%*+*@@@
%@@++%@@@@-::::::::=%@@@@*-:::::::-=@@@@%*%@@=
-@@@%@@@@@@.. ..:*@@+.. .-@@@@@@%@@@
*@@@%*%@@@ :%@%. .-@%. -%@* :@@@%*@@@@-
%@@+=%@@@ .+*+. :=*@%+=. :+*= :@@@*=*@@=
@@*=%@@@ =@+----*@: :@@@%=%@+
-@@@@@. .+%+-=*%- :@@@@@.
-@@@@@.. .+%*=. .-@@@@@.
.@@@@@... ...-@@@@%
:@@@@-..... ......+@@@@
%@@%=:....................:+@@@+
+@@@*+================+*@@@-
.%@@@@@@@@@@@@@@@@+
This is particularly useful for logos and designs where contrast is essential.
Specifying Characters for ASCII Art
You can customize the characters used in your ASCII art by specifying them with the --chars
option. This allows you to define a set of characters to represent the pixels in your image:
jp2a --chars=" .:-=+*%@#" myimage.jpg
Sample Output:
.......:::--::........
.....-+*%%@@@@%@@@%*+=:.....
....=*@@%%****************=:....
...:+@@%**************+++++++++-....
...-@@****++********++++++==++==+=:...
...+@*=+**-..=***+++++++++:..-==--==:...
...:-::-+**+==+++++++++++===--===-::::....
...:-=+++=--------------------------=--:....
..:++=:..............................:-=-...
...==:....*%%%%%%%%+:....-*%%%%%%%*+....:-:...
...:......@@######@@%-..=@@#######@*......:...
....:-:...###%:.:@##@*.:@###*:.-###%...:-....
...=+:...###@=-=@#%+-.:=+@#%=-+###%...-+-..
..-+:...########+.=****-.%#######%...:+:..
.....@#######@=:=*+-:*########%.....
.....@@########@=:-+@########@*.....
.....@@@###################@@@*.....
....*@@@@@#############@@@@@@=....
...:+%@@@@@@@@@@@@@@@@@@@@%=....
....-=++++++++++++++++=-...
..................
In this example, the characters .:-=+*%@#
are used to create a textured output, allowing for more detailed representations.
· · ─ ·𖥸· ─ · ·
Advanced Features of jp2a
Batch Processing Multiple Images
If you want to convert several images at once, you can use a loop in your terminal:
for img in *.jpg; do jp2a --width=100 "$img"; done
This command will convert all JPEG files in the current directory to ASCII art.
Saving ASCII Art to a File
jp2a myimage.jpg > output.txt
To save your ASCII art to a text file for future use, redirect the output:
Contents of output.txt:
.......:::--::........
.....-+*%%@@@@%@@@%*+=:.....
....=*@@%%****************=:....
...:+@@%**************+++++++++-....
...-@@****++********++++++==++==+=:...
...+@*=+**-..=***+++++++++:..-==--==:...
...:-::-+**+==+++++++++++===--===-::::....
...:-=+++=--------------------------=--:....
..:++=:..............................:-=-...
...==:....*%%%%%%%%+:....-*%%%%%%%*+....:-:...
...:......@@######@@%-..=@@#######@*......:...
....:-:...###%:.:@##@*.:@###*:.-###%...:-....
...=+:...###@=-=@#%+-.:=+@#%=-+###%...-+-..
..-+:...########+.=****-.%#######%...:+:..
.....@#######@=:=*+-:*########%.....
.....@@########@=:-+@########@*.....
.....@@@###################@@@*.....
....*@@@@@#############@@@@@@=....
...:+%@@@@@@@@@@@@@@@@@@@@%=....
....-=++++++++++++++++=-...
..................
This allows you to share or archive your ASCII art creations easily.
Applying Filters
You can apply various filters to enhance your ASCII art:
jp2a --filter=gray myimage.png
Filters like gray can change the aesthetics of the output, providing different artistic effects.
Creating ASCII Art from Photos
For converting personal photos into ASCII, use:
jp2a --width=80 --color photo.jpg
Sample Output:
\033[31m.\033[0m \033[34m.\033[0m
\033[33m...\033[0m \033[32m...\033[0m
\033[34m......\033[0m \033[35m......\033[0m
\033[36m.......\033[0m \033[37m.......\033[0m
\033[30m...............\033[0m
\033[32m.............\033[0m
\033[33m.............\033[0m
This allows you to preserve the original photo’s details while creating a striking ASCII representation.
· · ─ ·𖥸· ─ · ·
Cool Things You Can Do with ASCII Art
ASCII Art isn’t just for fun—it’s surprisingly versatile:
- Spice up your project’s
README.md
- Generate login banners for SSH or Termux sessions
- Add flair to your email signature
- Create unique visuals for blog posts, wikis, or PDFs
- Use in terminal-based games or apps (hello, roguelikes)
· · ─ ·𖥸· ─ · ·
Automate It: Convert a Folder of Images
Want to convert an entire folder of images into ASCII Art? Here’s a quick shell script you can use:
#!/bin/bash
mkdir -p ascii_output
for img in *.jpg; do
filename=$(basename "$img" .jpg)
jp2a --width=80 "$img" > "ascii_output/${filename}.txt"
done
Now you’ve got a batch pipeline for turning photos into terminal-ready art. Toss this into a cron job, and you’ve got yourself ASCII surveillance. (Sort of.)
· · ─ ·𖥸· ─ · ·
Troubleshooting Common Issues
While jp2a is straightforward to use, you may encounter a few common issues:
- Image Too Large: If your ASCII art appears distorted, try reducing the image size or changing the output width.
- Unsupported Format: Ensure that your input image is in a supported format (JPEG, PNG).
· · ─ ·𖥸· ─ · ·
Looking for Alternatives?
While jp2a
is fast and effective, here are a few other FOSS tools you might want to explore:
cacaview
– Terminal image viewer with ASCII Art supportimg2txt
– Convert images to text, supports multiple output formatsaafire
– For pure ASCII flames (because why not?)
These are all open source, lightweight, and a great way to expand your ASCII Art toolkit.
· · ─ ·𖥸· ─ · ·
Bringing Pixels to Characters: Your Turn to Create
What started as a nostalgic curiosity—seeing ASCII Art of Tux on a dimly lit terminal—can now become your own creative outlet. With jp2a
, you’re not just converting images; you’re telling stories through characters, crafting retro visuals that speak louder than pixels ever could.
Now it’s your move. Fire up your terminal, pick an image, and start experimenting. ASCII Art isn’t just about looking cool—it’s about turning code and creativity into something uniquely yours.
Try it today, and let your terminal become your canvas.
Leave a Reply