Re: adding text to JPEGs, in bulk

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

 



From: "François Patte" <francois.patte@xxxxxxxxxxxxxxxxxxxxxxxx>
Amadeus W. M. a écrit :
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?

All these answers about adding comment text to jpeg are interresting but
the result is "binary". I have been seeking for a while (and did not
find an answer) on how to annotate an image with a "grep readable"
annotation. If I use Gimp or ImageMagick, to write the comment "foo" in
an image, grep foo image.jpg returns "binary file image.jpg matches".

Is there a way to add a comment in ascii characters in an image? And to
be able to use grep to find the images with a particular string in it?

To be more clear: I am working with image of manuscripts and I want to
able to add a commentary to each image like "in this image the subjet is
..." Then I could use grep to find out what are the images which contain
a particular subject.

There is some tool like this with gThumb, but the commentaries are in
separates files, written in xml (cannot use grep!) and this is quite
tricky to maintain a synchronisation between several computers (using
rsync for instance).

You may have to go to TIFF or something similar to get that
functionality.

{^_^}

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

  Powered by Linux