Page 1 of 1

Arch annotate

Posted: 2017-09-11T19:57:04-07:00
by Zelf
This is my current command, which works to print simple annotations, but I want "Arched Top Text" and "Arched Back Text" to be arched like in the guide http://www.imagemagick.org/Usage/fonts/#arch. And I want to do it all from one command. I've been trying to use +clone and run commands, but I end up with a warped image.

Code: Select all

magick front.png +append \ 
back.png -append \
-font Tahoma -pointsize 150 -gravity north -fill yellow -annotate +0+200 "Arched Top Text" \
-font Tahoma -pointsize 150 -gravity north -fill yellow -annotate +0+500 "Bottom Text" \
-font Tahoma -pointsize 150 -gravity south -fill yellow -annotate +0+750 "Arched Back Text" \
out.png

Re: Arch annotate

Posted: 2017-09-11T20:33:42-07:00
by fmw42
To arch text, you must create the text image first and then use -wave to distort it into a an arch. See the example at the link you referenced. Your syntax is not proper either. You must put the appends after each pair of images you want to append. I suggest you also create the text images inside parenthesis processing. see http://www.imagemagick.org/Usage/basics/#parenthesis

Try the following to get an idea how to do the arching. I use label: to create a text image and wave to arch it. Then I use -gravity -geometry and -composite to position it on the background image. (Unix syntax)

Code: Select all

magick -size 1200x1200 xc:black \
\( -background none -font Tahoma -pointsize 150 -gravity center -fill yellow \
     label:"Arched Top Text" -wave "-50x%[fx:2*w]" -trim +repage \) \
    -gravity northwest -geometry +0+200 -compose over -composite \
\( -background none -font Tahoma -pointsize 150 -gravity center -fill yellow \
    label:"Bottom Text" -trim +repage \) \
    -gravity northwest -geometry +0+500 -compose over -composite \
\( -background none -font Tahoma -pointsize 150 -gravity center -fill yellow \
    label:"Arched Back Text" -wave "+50x%[fx:2*w]" -trim +repage \) \
    -gravity northwest -geometry +0+750 -compose over -composite \
result.png

Re: Arch annotate

Posted: 2017-09-11T20:52:23-07:00
by Zelf
Thank you. That clears up a lot of things. Thank you!

Re: Arch annotate

Posted: 2017-09-12T10:46:26-07:00
by Zelf
How do I get rid of the line coming off the bottom left of the "A"'s you can see on the -distor Arc labels?

Image

Every time I use -distort Arc I am getting the strange artifact line on the bottom left corner of the text. I've tried several different fonts thinking maybe it was a font issue, but I've ruled that out.

Code: Select all

magick front.png back.png -append \
\( -background none -font "Tahoma" -pointsize 105 -gravity center -fill "#FFB820" label:"ABCD" -distort Arc 30 -trim +repage \) \
-gravity north -geometry +0+250 -compose over -composite \ 
\( -background none -font "Tahoma" -pointsize 105 -gravity center -fill "#FFB820" label:"ABCD" -trim +repage ) \
-gravity north -geometry +0+630 -compose over -composite \ \
\( -background none -font "Tahoma" -pointsize 90 -gravity center -fill "#FFB820" label:"ABCDE" -distort Arc 50 -trim +repage \) \
-gravity south -geometry +0+710 -compose over -composite out.png 2>&1

Re: Arch annotate

Posted: 2017-09-12T10:50:35-07:00
by GeeMack
Zelf wrote: 2017-09-12T10:46:26-07:00How do I get rid of the line coming off the bottom left of the "A"'s you can see on the -distor Arc labels?
Before your "-distort ..." operation you need to set the virtual pixel behavior with "-virtual-pixel none".

Re: Arch annotate

Posted: 2017-09-12T10:59:03-07:00
by Zelf
That did it. Thanks GeeMack!