Arch annotate

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
Zelf
Posts: 12
Joined: 2015-05-12T11:14:41-07:00
Authentication code: 6789

Arch annotate

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

Re: Arch annotate

Post 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
Zelf
Posts: 12
Joined: 2015-05-12T11:14:41-07:00
Authentication code: 6789

Re: Arch annotate

Post by Zelf »

Thank you. That clears up a lot of things. Thank you!
Zelf
Posts: 12
Joined: 2015-05-12T11:14:41-07:00
Authentication code: 6789

Re: Arch annotate

Post 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
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Arch annotate

Post 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".
Zelf
Posts: 12
Joined: 2015-05-12T11:14:41-07:00
Authentication code: 6789

Re: Arch annotate

Post by Zelf »

That did it. Thanks GeeMack!
Post Reply