Re: adding text to JPEGs, in bulk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 16 Sep 2006 02:22:20 +0930, Tim wrote:

> Hi,
> 
> Is there an easy way to add some text to a collection of JPEGs?  For
> instance, I'd like to stamp the words "PROOF" across a collection of
> JPEGs I'm showing someone to pick out which ones they'll buy copies of,
> showing them a full sized, full quality, version of the images, but ones
> that they can't just nick.  I really don't want to have to hand modify
> each image in turn, there's about 300 of them.
> 
> -- 
> (Currently running FC4, occasionally trying FC5.)
> 
> Don't send private replies to my address, the mailbox is ignored.
> I read messages from the public lists.

This is what you do:

1) The "convert" program from ImageMagick can do all sorts of
image transformations, including writing text on top of an image.
I don't know the syntax off the top of my head, so you'll have to
look that up. A simple

convert -h 

will show you what it can do. You want to look at the -draw 
primitive. Better yet, look here:

http://www.imagemagick.org/script/convert.php

For instance 

convert -fill red -font Bookman-DemiItalic -pointsize 32 -draw "text 30,30 TEST" input.jpg output.jpg



2) Once you're happy with the results, do all jpgs in a for loop:

for file in *.jpg
do
	outputname=`basename $file .jpg`_out.jpg
	convert [drawing command] $file $outputname
done

You can do this directly at the prompt, or you can save it in
a bash script.

Command line comes in pretty handy, doesn't it?




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux