Extract the file and make the particular font file in an easily accessible location.
Now, run the command:You can create several images unique to your system. Let’s see some examples:
Table of Contents
Wordcloud, the wordcloud generator
Let’s say you have 100 random words saved to a file called words.txt
. To create an image from this file, use the command:If you are ok with exposing your bash history, save all the commands to a text file and then use this text to create an image.I am going to use the Comic Neue font to create the image. You can download fonts from Google Fonts website.
Install wordcloud
The project page has several examples available. Click the button below to check those.Did you see cool wallpapers like the one below on communities and wallpaper websites?Now, I will use the command:
Wordcloud is available in default repositories of Ubuntu. To install it, use the command:Here, you can click on a particular design and download the corresponding Python script.
By the way, if you are new to the Linux terminal and command line, check out our tutorial series which is written for the absolute beginners.Wordcloud offers several options and features that you can use to create unique images. Let’s see some cool items!
Use prebuilt examples
sudo apt install python3-wordcloud
wordcloud_cli --text </path/to/words.txt> --width 1920 --height 1080 --imagefile highres.png
By default, wordcloud uses DroidSansMono font. If you need to create an image with a custom font, use the --fontfile
option.In this tutorial, I will show how you can make such wallpapers and images in a very short time. Trust me, you don’t need to be a Photoshop or GIMP Pro to do this!
Possible image ideas
For example, I am using this example, where the words file is called alice.txt
and the mask file is called alice_mask.png
. So, I will rename my words.txt as alice.txt and mask image as alice_mask.png. This way it is easier than renaming variables and items inside the script.
Installed packages
pipx install wordcloud
On a similar note, you may want to use this handy CLI tool to convert images into ASCII art:
Your bash command history 😉
Now, imagine you have created a text file with hundreds of words using ChatGPT or some AI clients. In this case, a higher resolution image will do better. Let’s see how to create a bigger image!📋wordcloud_cli --text </path/to/words.txt> --width 800 --height 400 --fontfile </path/to/font/file> --imagefile customfont.png
You should specify the font file location to the --fontfile
option. So you should have the required file in hand.