Getting Text Aligned to the left of an Image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
fedora_linux
Posts: 3
Joined: 2011-12-28T13:20:26-07:00
Authentication code: 8675308

Getting Text Aligned to the left of an Image

Post 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!
fedora_linux
Posts: 3
Joined: 2011-12-28T13:20:26-07:00
Authentication code: 8675308

Re: Getting Text Aligned to the left of an Image

Post 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 
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Getting Text Aligned to the left of an Image

Post 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
fedora_linux
Posts: 3
Joined: 2011-12-28T13:20:26-07:00
Authentication code: 8675308

Re: Getting Text Aligned to the left of an Image

Post by fedora_linux »

Brilliant! Cheers Mate!
Post Reply