Page 1 of 1

Getting Text Aligned to the left of an Image

Posted: 2011-12-28T13:30:07-07:00
by fedora_linux
Hi everyone!

I'm loving working with Image Magick, it's amazingly powerful! I'm using the command line utility on Fedora Linux.

I've been trying to get text to sit to the right of an image while being aligned, and I've been trying to achieve this by reading the Annotation doc here:

http://www.imagemagick.org/Usage/annotating/

But I haven't had any luck using this. My goal is to have something that looks like this: (jpg is the image)

Code: Select all

--------    text here
|      |    text here
| jpg  |    text here
|      |    text here
--------    text here
How could I achieve this? I have the text showing when I don't show the image, but when the image is loaded it seems to hide all the text, so far I have this

convert mypic.jpg -gravity east -resize 100x100 -background none -fill black -font Utopia-Italic -pointsize 24 -geometry +200 label:"$1" \
-font Utopia-Regular label:"$2" -append \
-font Utopia-Regular -gravity east label:"$3" -append \
-font Utopia-Regular label:"$4" -append \
-font Utopia-Regular label:"$5" -append \
-size 720x480 label.gif

Any resources or suggestions would be hugely appreciated, thank you!

Re: Getting Text Aligned to the left of an Image

Posted: 2011-12-28T14:43:06-07:00
by fedora_linux
So I have been getting closer!!

My command now looks like this:

convert mypic.jpg -resize 300x300 -background none -fill black -font Utopia-Italic -pointsize 24 label:"$1" +append \
-font Utopia-Regular label:"$2" -gravity east +append \
-font Utopia-Regular -gravity east label:"$3" -append \
-font Utopia-Regular label:"$4" -append \
-font Utopia-Regular label:"$5" -append \
-size 720x480 label.gif

And it creates an image that looks like this:

Code: Select all

--------    1
|      |    
| jpg  |    2
|      |    
--------    
               3 
               4
               5 

Re: Getting Text Aligned to the left of an Image

Posted: 2011-12-28T15:56:36-07:00
by fmw42
try this

input
Image


convert \( -size 64x128 -pointsize 18 -gravity east label:"test1\ntest2\ntest3\ntest4\ntest5\ntest6" \) \
zelda3.jpg +swap -gravity center +append zelda3_label.jpg


Image

Re: Getting Text Aligned to the left of an Image

Posted: 2012-01-03T19:36:23-07:00
by fedora_linux
Brilliant! Cheers Mate!