ImageMagic commands help

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
vin_akleh
Posts: 1
Joined: 2011-08-16T06:58:56-07:00
Authentication code: 8675308

ImageMagic commands help

Post by vin_akleh »

i am new to this ImageMagic thing.
i have this command

Code: Select all

convert -font $arial \(  \( -pointsize 14 -fill black -gravity south label:\"Scan or \" +append \( $overlay  -scale 90x90 \) -gravity south -append \( -background white   \( -pointsize 44   -fill black -gravity southeast  label:\" text \nto \"  -fill $textColor -font $arialBold  -gravity southwest label:\" $keyword\n 467467 \" -scale 60%x90%  -bordercolor white -border 0x10 \) \) -gravity North +append \(  -fill black -font $arial -gravity West -pointsize 8.5 -draw \"text 130,48 ' MSG & Data rates may apply.'\" \) -append  \)     \) -resize 530x120 -gravity center -extent 100%x120 -density 600 -sigmoidal-contrast 10x69% $tempFile -resize 530x120 $tempFile1"
what i need to do is like so:


_scan__ or
"image" text "sometext"
________to__467467

and not like so:

_scan or
"image" text "sometext"
_______to____467467

i need the "or" over the "text" and not over the image as it is in this command, any body have any ideas (note the "_" is space character)
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: ImageMagic commands help

Post by anthony »

You will need to use a fixed width font so spaces and characters are all the same width.
alternativally you will need to position individual words.
Getting the width of individual words can be done by retrieving font metrics...
http://www.imagemagick.org/Usage/text/#font_info

For example by getting the width of the strings '"image" ', '"image" text', and 'or' in the font/density/pointsize you plan to use, will let you calculate the exact X offset needed to center the 'or' word over the 'text' word! (at least to the nearest integer pixel)


Note that IM is not a Word processor, but a Image processor. Using the right tool (such as TeX which can handle text positioning, spacing etc) is always a better option. For other options see...
http://www.imagemagick.org/Usage/text/#tex
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply