Hi,
I would like to label lots of photographs for a website as NatGeo does with some of their shots (ie http://2.bp.blogspot.com/-4mxYjp-CyUE/U ... 712187.jpg) Just the text part at the bottom-right, not the logo.
As far as I understood ImageMagick's power, it would be enough to determine the width of the images, create a semi-transparent rectangle and Annotate some text over it with "gm compose..."
My doubts are:
a- Is it possible to create a semi-transparent rectangle that fits exactly the size of the text? Should I create an image with the text first?
b- Is it possible to align it to the bottom-right (southeast) of the image?
TIA. -Seb
Label pictures
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Label pictures
That is a GraphicsMagick command? This is not GraphicsMagick forum, it is Imagemagick.gm compose...
Nevertheless, all what you ask is possible. You would create the text on a semi-transparent background using convert ... label:"yourtext" and then composite it over the image using -gravity to set to the desired corner.
Something like (unix syntax)
( for windows remove the \ before the parens)
convert backgroundimage \( -backgroundcolor "rgba(255,0,0,0.5)" -pointsize 18 -font arial label:"yourtext" \) -gravity southeast -compose over -composite resultimage
see
http://www.imagemagick.org/Usage/text/#label
http://www.imagemagick.org/script/color.php
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/compose/
http://www.imagemagick.org/script/comma ... hp#gravity
Always a good idea to provide your IM version and platform!
Re: Label pictures
Thanks a lot, yes, I'm using Linux, a little overhelmed and confused for the tons of options and by mistake have replaced imagemagick with graphicsmagick... that didn't helped I suppose. Now have installed ImageMagick 6.6.7. Thanks again.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Label pictures
IM 6.6.7 is quite old (over 200 versions). You would be best to upgrade if you can.