3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Add text to images with Linux 'convert' command

Add text to images with Linux \
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.
 
Remove these adsRemove these ads by Signing Up
 

Step 1The 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.

« Previous StepDownload PDFView All StepsNext Step »
11 comments
Feb 16, 2009. 1:07 PM11010010110 says:
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
Dec 2, 2010. 4:56 PMhintss says:
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)?
Feb 27, 2009. 10:06 AMxACIDITYx says:
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.
Feb 27, 2009. 10:57 AM11010010110 says:
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
Dec 2, 2010. 4:55 PMhintss says:
my vista partition on my other machine broke
Feb 27, 2009. 5:08 PM11010010110 says:
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
Mar 2, 2009. 12:45 PM11010010110 says:
enjoy !
Dec 2, 2010. 4:54 PMhintss says:
*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
Apr 28, 2010. 3:23 PMComputothought says:
Cool... New trick for the arsenal.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
38
Followers
9
Author:rhackenb