labelling with ImageMagick

I’ve been batch processing hundreds of images, homing in on the most useful ones for my bricoleur ludique website.  My Perl script jpgMagick.pl has proved an exceedingly useful tool. Here, I describe how to create a simple transparent label to add to images.

You need ImageMagick on your machine, and if you’re going to use the PerlMagick API, you might want to look in my DokuWiki to find how to get these installed together on Windows 7.

Adapting Anthony Thyssen’s example:

convert -size 179x36 xc:none -font Segoe-Print -pointsize 20 -stroke black -strokewidth 8 -annotate +7+26 "josephharriott.fr" -blur 0x8 -fill goldenrod1 -stroke none -annotate +7+26 "josephharriott.fr" jhfr-label.png

and I’ve created a transparent label with colored text:

png label for josephharriott.fr

-annotate is counting placing the text 7 pixels in from the left, and 26 down from the top, so for a more discreet label:

convert -size 127x33 xc:none -font Segoe-Print -pointsize 12 -stroke black -strokewidth 8 -annotate +12+21 "josephharriott.fr" -blur 0x7 -fill darkgrey -stroke none -annotate +12+21 "josephharriott.fr" jhfr-label.png

josephharriott.fr png label

Next I apply the label to the lower-right corner of one of my photos:

composite -gravity southeast jhfr-label.png originalphoto.jpg labelledphoto.jpg

See the effect here.  When I want to label a load of images in a folder, I turn to my jpgMagick.pl.

Share Button