book collections email follower instructable user
Picture of Add text to images with Linux 'convert' command
This instructable will show you how to add text to an image using the convert command in Linux. One valuable use of this is the placing of a caption on an image for documentation. Another use would be the placing of a time stamp on an image that gets generated automatically by a webcam.

There are many convert options that you can make use of in placing text on the image. You can choose the starting point for the text (via a height/width coordinate), the fill color of the text, the point size of the text, and the font used. This instructable will show you how to do all this.

The major catch with this instructable is that you have to do all this in the Linux operating system. I'm not aware of a utility such as convert in Microsoft Windows but who ever does anything with a command line in Windows? This instructable is more aimed at Linux users who want to get more out of their computer. If you are a Windows user and are still tempted to read this instructable, you may be tempted to download and install Linux. I may write an instructable on how to do this at a later date but if you want to pursue this on your own, you can go to http://www.ubuntu.com/ and start the process. You can turn your computer into a dual-boot machine (I'd really recommend that you install a second hard disk in your machine -- any size will do). BTW, Linux is FREE, along with everything available to it. Also, so far, it is invulnerable to viruses.

Step 1: The linux 'convert' utility

To perform the task of adding a label to an image, we will be working entirely within a Linux terminal window. Windows calls this a command window but it is rarely used in Windows except by oldtimers who remember it from the DOS days. Linux users make heavy use of it.

First of all, bring up a terminal window. With Ubuntu Linux, you do this by selecting Applications->Terminal. A window will open up with a command line prompt. It will put you at your home directory.

Let's assume that the image you want to play with is in an "images" subdirectory. To get to that subdirectory, type "cd images". Issue the comman "ls" to see what files are there. In my case, I want to work with a file called "sunset1.jpg".

You also want to make sure that the convert command is available on your system. One way to do this is to issue the command "which convert". If it is available, its location will be printed to the screen. In my case, it is at "/usr/bin/convert". Another way to find out if it is available, just issue the command "convert" at the command line. If it is there, a long description of the command will be printed out with all the options available. If it is not there, you will see "convert: command not found". Let's assume that it is available.

If you issue the bare command "convert" you can see that it is a very powerful tool with many capabilities. A more complete description of the convert command can be found at:
http://linux.about.com/od/commands/l/blcmdl1_convert.htm

For our purposes, we only want to use the "-draw" argument to write the caption to the photo.

You can also use PixTeller directly from your browser - it has a very nice user interface and so easy to use. It's excellent to add text over images and also it has a lot of text editing options like curve text, wrap text.

You may take a look here: https://pixteller.com/create/quotes
picture-quote-editor.png
I use Peppermint operatng system. I've installed "lucida calligraphy", "comic sans ms" and verdana. Now when using "convert" I don't have access to them. When I try to change the font, "convert" doesn't accept. Then I write "-font verdana" and nothing happens but a lot of information saying that it impossible for me to use "verdana". And I don't even know where verdana is. I've tried to find it but I haven't succeeded.
rhackenb (author)  Fernando Melo Medeiros3 months ago
I'm afraid that I have not had much experience in the use of fonts with this application.
To see the fonts it knows about issue the following command in a terminal:
convert -list font
This will give you a very long list of the fonts it can handle. You can add a grep to the command such as
convert -list font | grep Comic
This does not find anything with Comic (or comic).
Maybe you can find a font that is closest to what you are looking for.
How to choose the language to use?
How can I change the language used in the captions?
JeesX1 year ago

how to add caption to an image using text editor

"convert" is an usful information it would helpful for my site www.eternessehyd.com

for these linux users "convert " is an usul inforamtion for studying, for more online training program visit www.ittrainingsonline.com

MarketingT13 years ago

For Linux users, "Convert" is a good comment to add text to images. We are also in exploring Linux OS and sharing with our students. If anyone is looking for building skills in Linux administration, then refer this link.http://www.kerneltraining.com/linux-admin-training/.

ShubhamB30 made it!3 years ago

Meri taqdir me ek bhi gam na hota agar taqdir likhne ka haq meri maa ko hota

o-MOTHER-DAY-GIFT-facebook.jpg
buyiw3 years ago

I'm not a developer, I always use this free online image converter(http://www.online-code.net/image-converter.html) to convert image.

buyiw3 years ago

I'm not a developer, I always use this free <a href="http://www.online-code.net/image-converter.html">online image converter</a> to convert image.

buyiw3 years ago

I'm not a developer, I always use this free online image converter(http://www.online-code.net/image-converter.html) to convert image.

Chanio4 years ago
Thank you! Very useful!

One way that I make use of this is where I automatically put the
timestamp on an image that my webcam generates once a minute. In a Perl
script
...

There is also an Image::Magick perl module that works the same on any platform.

If you add captions automatically, you might find that in some cases, the color of the text blends with a background. In this case, you might want to use the 3D captions technique:

convert -pointsize 20 -fill white -draw 'text 268,458 "Sunset over the Nile" ' -fill black -draw 'text 272,462 "Sunset over the Nile" ' -fill yellow -draw 'text 270,460 "Sunset over the Nile" ' sunset1.jpg sunset2.jpg

That way, there is always the chance that a white or black version of the text would be legible over the background color...

supriyas14 years ago

how do i get a paragraph Text using terminal .. think my text has to be like

wish you

Happy New

and how do i get a good front..

1101001011010 years ago
convert is part of image magick. it exists for windows too

you still are wellcome to the linux world ! though i'd suggest mandriva kde (for most users) or arch (for advanced users) over ubuntu
I'm thinking of switching to arch. anything I should know (yes, I know its simple, from a programmers point of view, I read the wiki some, I read the beginners guide, etc)?
Blegh. Ubuntu is the easiest for new users, especially with it's very extensive documentation with fixes for essentially all problems you may come by.
ubuntu has few times more problems than any other distro i tried ubuntu newbies come to me to ask for help with amont of problems way higher than other distros
my vista partition on my other machine broke
rhackenb (author)  1101001011010 years ago
I have installed Ubuntu for several of my friends. One of them, a 75 year old who was having virus troubles with Windows, brags about his installation. The only time he has contacted me about a problem was after a major automatic upgrade, he was not able to print anymore. I told him to chose his printer instead of the default PDF target that Ubuntu mysteriously choses as the default. After he simply looked at his choices, the problem was solved. Ubuntu is an excellent installation and a great replacement for Windows for people who don't really do more than browse the web and check their web-based email. They don't even notice the difference. Of course, it's good for most everything else. Ubuntu is the best distribution I every found, mainly because of it's ability to install software from many sources.
you should be lucky. enjoy ! i know ubuntu as a distro slower than windows xp (unless windows is infected or overloaded with crap) and one that creates problems every here and there and they come back after you allredy fixed them
rhackenb (author)  1101001011010 years ago
My experience is completely the opposite. I dual-boot machines and I always find Ubuntu to be faster than XP on the very same machine. I generally have no problems with ubuntu once I get stuff installed. I never see a problem get solved and then come back. The only real problem I ever have is when I don't automatically have drivers for things like Wi-Fi receivers. However, once the driver is installed, there are nor more problems with it. I installed Ubuntu on a 75 year old's machine. He is totally amazed by how fast the linux side runs compared to his XP side (I had totally wiped his XP and reinstalled it). He never calls me with problems. I've been using various distributions of Linux since the early 90's. Ubuntu is by far the best and most user-friendly. It now even performs major upgrades to the kernel without assistance from me.
enjoy !
hintss8 years ago
*almost everything is free

anyway, you should try phatch. it batch processes photos, and it has many capabilities. and the best part: its for linux only! muahaha
Cool... New trick for the arsenal.