Image to ascii art linux

How to convert graphical images to ASCII art?

I want a custom image in my terminal made of characters, is there a program I can use? Specifically, the gear within my school’s robotics logo.

2 Answers 2

One app you can try jp2a for jpg to ascii for terminal windows.

sudo apt update sudo apt install jp2a 

Then just run jp2a filename.jpg

~$ jp2a 1Fy7Yz2.jpg .dKKKKKl. dKK000000OOOOkkkxxxxddoooooolloddxxxkO00k. '0KKKK0..'. oKKK000000OOOOOkkxxxdddooooollodxxxxkO00O. dKKKK0. '.:KKKKK0000000OOOOkkxxxddddoooooxxxxkOO00O'. 0KXK0. . ''. ;;;;;;;;;;;. '''''.''''. '';;. O0O0o. . 'l. 0K0kkkxxxdol:. . ;;. . . . . d000kkOKKKKKKk. .dO000klooc;. . .'. ccood;. c. ..oOkdx0KKK0KKx. ,,od.l'xdl. ':ldkkkkxxdxO0KXo. cc. . :kxodk00O;0K0k, 'l. ;;cok00OOkxxxkkxxxk0Kkkk. k. ..lxdookkOl.'OKKOd;,;coxO0000OkdoodkOOOkxddk0KkodOxdk. loldccdxkk. oKKK00KK0OkxdolodkOO000OOkxddk00koddxkl. dd,;coddxx'. oxxddollodxkkOOOOOOOOOkkxddk000loO0d. ::ldxxooodd. ;kxxxkkkkkkkkkkkOOOOOOOko:'. 'oloxKo. olcldOOxolloo;,kkOOOkkkkkkkkkkkkOOko;. .. ,cdkx;. l:ccl:odOkdccloxkkkkkkkkkkkkkkkxc. ..'',;.''odOd. dxl. ;clkkxlccodxxkkkkxxxxd:. .':ldxkxdddxkOl.;dxld. odddl:;;;;:cxkkdlcloddddol:,';coxxxkkkkxxdddxkOdllxkoll. clooddc;;;;;;okkkxdllloodddddxxxxxxkkkkxxdodxkkkllkOkk. :cclloddc:,oxxxxdddoodddddddddxxxxxkkkxxxdoodxkOooxxkk. ;;:cclloodoollllloodddddoodddddddxxxxxxxdooldxkOoOxddxxc. .',;::ccccccccllloooddddddoooooodddxxxxo:,'',;:ddkdooodd. .',;;::cccllllllooooooodddoooooodddo;.. . 'okollllod. .,'. ccclllllllloooooooodollooooo;. . . cxlcclllo;. 

Or you can use —background=light if you have a light background in your terminal:

~$ jp2a 1Fy7Yz2.jpg --background=light K. l0000K. ''''. ;;;;::ccccccllc::;;;,'. 0000000KKKKKKKKKKKKK O. 00O00Kc. ''''',,;;;. cccccllc:;;;;,'..'0000000KKKKKKKKKKKKK . kK000O0d. '''',,;;;. ccccc;;;;,''..'O000000KKKKKKKKKKKKK . KMNXXXXXX00OOkkkkkxxxxxxxxxxxkkkOOOOO0OOOO0000OOxxKKKK0KKKKKKKKKKKKKK '.'.cKK0KKXXXXXXXNNNWWWWWWWWWMMMMMMMMMMMMMMMWNNNNNXXKOl0KKKKKKKKKKKKKKKKKK . ;;;:cld0MMWW0kdxxKKXKXNNWWWWMMMMMXNNWK0XWXNNNKKKKKKKKKKKKKKKKKKKKKKK . '. KMW0:'. lccox00XNKWNKOdddoocc:x0X0NokKKKKKKKKKKKKKKKKKKKKK 0Xc',:;. ;XWNkkc:0lO;:lKWNOdl. ;;:;'. cXNNooKKKKKKKKKKKKKKKKKKKKK KNd,;c. 'x. kWNNOlkkKxxoc. '',;;;,,;;;. dkk,0KKKKKKKKKKKKKKKKKKKK 0Xl;:cc,,'lXO'..':xkxoc;'. ',:cc:,''',;. c:';:,0KKKKKKKKKKKKKKKKKKKK lcl:oo:;,,0KX0c. ',;:clc:,''. '',;. c::;,lKKKKKKKKKKKKKKKKKKKKK ::kxoc::;;OKXXK0c;;::cllc:;,,''''''''',,;. lc'.:KKKKKKKKKKKKKKKKKKKKKK ddl:;;ccc::kKKXx,;;;. ''''''',cdOKKKOclc;.cKKKKKKKKKKKKKKKKXXXXXX clol:'';cllccxk,,'''. '',cx0NWMWNNX0Wko:,;xKKKKKKKKKKKKKKKKKKKKK ldooldc:',:oolc;. ;o0WNNNNNX0OOkxKOOc:':dKKKKKKKKKKKKKKKKKKKK :;lddddxol,,;looc:;;. ;;;;:d0NNKOdl:;,;. ;,'lKx:;l:kKKKKKKKKKKKKKKKKKKK c. ldxxxxdo;. lolc. cldkOxoc;;;. ;;. ;,':ll;,cll00KKKKKKKKKKKKKKKKK olcc::oxxxxxxc. ;:lllcc. ;;;;;;. ;;:c:;. ll,',,d00KKKKKKKKKKKKKKKKK doollc::odkc;;;;. cc. ;;;;;. ;;;:cc:;,'cc;;,,dKKKKKKKXXXXXKKKKKKK xxdoollcc:cclllllcc. cc. ;;;;;;;:ccl:;,'c';::;;oKKKXXXXXXXXXKKKKKK 0Okxddoooooooolllccc. cccccc. ;;;;cdkOOkxd. ccc::dXXXXXXXXXXXXXXXXX WW0Okxxddooollllllccccccc. cccccc. cxXXNNNXK0Oc,cllllc:0XXXXXXXXXXXXXXXX NWWKkOdddooollllllllcccccccc:cllcccccxKWNWKWX0K0o;loolllcxXXXXXXXXXXXXXXXX 

Here’s what it would look like in a terminal window:

Источник

10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal

Think Linux terminal is all about serious work? Think again. Here are a few fun things you can do with ASCII art in the terminal.

ascii art tools linux

Linux terminal is not as scary as you think. Of course, it could be intimidating in the beginning but once you know the terminal better, you start loving it. You are likely to use the terminal for serious work. But there are many fun stuff you can do in the terminal as well. One of them is experimenting with ASCII art. You can display predefined or random messages, play games, or run some animation in ASCII format in the Linux terminal using various command line tools. My teammate Sreenath likes to explore such unusual CLI tools and share his findings with me. I am sharing those findings with you. Most of these programs should be available in the repositories of your Linux distribution. You can use your system’s package manager to install them. To keep the article concise, I have only included the installation instructions for Ubuntu.

Читайте также:  Get time in linux terminal

1. lolcat: Add colors to your terminal

lolcat

Alright! lolcat doesn’t have anything to do with ASCII art. At least not directly. Still, I included it at the beginning of this article because you can combine other ASCII tools with lolcat. So, what does it do? It is similar to the cat command but it adds random gradient colors to its output. It may not look useful at the moment but you’ll see its impact when the outputs of other ASCII tools are piped through lolcat. Install lolcat with the apt command:

2. Aewan: Display ASCII text beautifully

Aewan is a multi-layered ASCII graphics/animation editor. It produces stand-alone cat-able ASCII art files and an easy-to-parse format for integration into terminal applications. It has two tools: aewan , an ASCII editor and aecat , for viewing the created file. I am not going to discuss the editor part here. aewan initial layoutTo display any text in pretty ASCII format, you need the aecat command. Notice the use of letters in the screenshot below. aewan outputTo install aewan use the following command:

3. Cowsay: Make an ASCII cow say whatever you want

What does the cow say? Whatever you want it to say. The cowsay is already a popular tool among seasoned Linux users. It shows an ASCII cow that repeats the text you provide it. cowsayBut you are not restricted to cows only. You can change it to several other characters as well. Like a dragon (burning King’s landing): cowsayDid you notice the colored output in the above screenshot? That’s the magic of the lolcat command I mentioned earlier. To install cowsay, use:

You can refer to this article for additional configuration and options.

4. jp2a: Convert images into ASCII art

jp2a

jp2a is a command-line tool that converts images to ASCII art in the Linux terminal. It works with JPEG and PNG files. It also allows colored output and your selection of character set to appear as ASCII image. You can install it using the following command:

jp2a --output=ascii.txt --colors input.png

It’s not the only program of this kind. There is ascii-image-converter and several other tools that could be used for the same purpose. I won’t discuss all of them in this list.

5. linuxlogo: Display the ASCII logo your Linux distro

The name says it all. It displays the Linux logo in ASCII format. No, not our beloved Linux logo, Tux but the logo of your Linux distribution. It also shows a few additional information like Linux kernel version, CPU, RAM, hostname, etc. You can install it using the apt command:

sudo apt install linuxlogo

6. Neofetch: Display the Linux logo along with system info

neofetch

The above linuxlogo command is too simplistic. You can amp it up by using Neofetch. It displays the distribution in a more pretty way along with several system information like kernel, uptime, desktop environment, theme, icons, etc. You can also parse it through lolcat to get rainbow-colored output. Install Neofetch using this command:

sudo apt install neofetch

And then just enter neofetch to run the command. There is also screenfetch, a similar tool to Neofetch. You can use either of them.

Читайте также:  Epson 3170 драйвер linux

7. fortune: Get your fortune told

fortune cookie linux

Just kidding! There’s no such thing. However, fortune cookies are still fashionable and apparently, people like to read random predictions or teachings. You can get a similar feature in the Linux terminal with the fortune command: You can install it using the following command:

8. pv: Make things animated

cmatrix

This is a classic example of the unintended use of a Linux command. The pv command is used to monitor the progress of data through pipe. But you can use it to animate the output of any command. Combine it with some of the above-mentioned commands and you can see the ASCII art appearing on your screen as if it is being typed. Don’t get it? Watch this video: You can install it with apt command:

It starts the animation immediately and it keeps on generating random green text falling and disappearing from the screen. The command keeps on running. To stop the running application, use the Ctrl+C keys.

10. cbonsai: Grow a bonsai in your terminal

Got a green thumb? How about growing an ASCII bonsai tree in the terminal? cbonsai is a fun Linux command that lets you run bonsai tree growing animation in ASCII format. I shared a YouTube Shorts of cbonsai command a few days ago. Can you put these commands to some good use? Not certain about the usability, but you can add some of them in your .bashrc file so that the command is run as soon as you open a terminal session. Many sysadmins do that on shared Linux systems. A program like cowsay or figlet can be used to display a message or system info in a pretty way. You may also use some of these programs in your bash scripts, especially if you have to highlight something. There could be other usages of ASCII art in Linux. I’ll let you share them with the rest of us here.

Источник

Convert Images to ASCII Art in Linux Terminal With This Nifty Little Tool

Want some fun in the Linux terminal? How about converting a regular image into ASCII art? This tool lets you convert any image into ASCII art.

Ubuntu Mate Focal Neofetch

Want to do some fun stuff in the Linux terminal? How about converting a regular image into an ASCII art? You know what’s ASCII? It’s a standard that assigns letters, numbers and other characters in the 256 slots available in the 8-bit code. The ASCII art is a graphics composed of the printable ASCII characters. Basically, it is composed of a bunch of letters, numbers and special characters. You might have seen people displaying their distribution’s logo in ASCII format like this: That’s cool, right? How about converting a normal picture into ASCII art? That’s what you are going to explore in this article.

Читайте также:  Tesseract ocr linux install

Ascii Image Converter

abhishek prakash in ascii

As the name suggests, Ascii Image Converter is a tool that converts an image into ASCII art. It is a command line based tool written in Go and it prints the ASCII version of the image supplied to it. You probably won’t recognize me, but that’s me in ASCII in the image below. That’s my 8-bit avatar. The tool supports input images in the following format:

  • JPEG/JPG
  • PNG
  • BMP
  • WEBP
  • TIFF/TIF

Let’s see about installing and using it.

Installing Ascii Image Converter on Linux

This nifty tool is also available on Windows but I am not going that way. Let’s stick to Linux in this tutorial.

If you have Snap enabled in your distribution, you can easily install its snap package using the following command:

sudo snap install ascii-image-converter

You may also download the Linux executable file from its release page and put the executable in the /usr/local/bin/ directory. This way, you’ll be able to run it like a regular Linux command. If you wonder why so, please learn about Linux directory hierarchy.

Using Ascii Image Converter

The usage is simple. Once installed, you just have to provide the path of the image you want to convert.

ascii-image-converter path_to_image

You may also provide the URL of the image to convert an image into ASCII directly from the web.

Here is my profile picture converted into ASCII. I have put my original photo for the reference.

Abhishek Prakash ascii converted

You may also have a colored ASCII conversion.

ascii-image-converter -C path_to_image

Abhishek colored ascii

You may convert multiple images into ASCII by providing their paths. It will print the ASCII version one after another on the terminal display.

There is also an option to save the generated ASCII art. In the older version, it would be saved only as a text file, not as an image. The developer, Zoraiz Hassan, released a new version and now the tool saves the generated ASCII image in PNG format by default.

ascii-image-converter path_to_image -s .

There are a few more options available such as giving the output a specific dimension, use more ASCII characters, or use your own set of characters for printing the ASCII art. You can read about it on the project’s repository.

Like it?

If you like experimenting in the terminal, you may like this tool. However, I wonder what could be a good practical use of an ASCII-converted image. Any ideas?

Источник

Оцените статью
Adblock
detector