Hi
I have an image saved as image.jpg and I wish to add text to it that is in the form of an arc. I have tried some examples from the documentation and can generate arc text but cannot add it to an image (without removing whats in the background).
Thanks in advance
Adding arc text to image
Re: Adding arc text to image
You will need to create your text as an image with a transparent background and place it over the original image.
What code do you have so far and IM version ?
What code do you have so far and IM version ?
Re: Adding arc text to image
Thanks for the reply
This is my version info:
Version: ImageMagick 6.4.5 2008-11-13 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
My current command does not work but none the less here it is:
convert image.jpg --pointsize 15 -fill white -annotate 0 "This Text Needs to be Curved" image_edit.jpg
This is my version info:
Version: ImageMagick 6.4.5 2008-11-13 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC
My current command does not work but none the less here it is:
convert image.jpg --pointsize 15 -fill white -annotate 0 "This Text Needs to be Curved" image_edit.jpg
Re: Adding arc text to image
I managed to get the text to curve but never manage to add it to an image. I cannot find the command I used tough.
Re: Adding arc text to image
The code below created this image:
You do not say how you are using the code; I did it in php and have removed the php parts from the code. I also needed to resize my image as it was a bit to big.
if your text is always the same it would be quicker to create your text and just overlay it each time:
Code: Select all
convert ( background_image.jpg -thumbnail 200x200 -write mpr:image +delete ) \
( -pointsize 20 -fill red -background none label:"Cottenham horse show" -virtual-pixel transparent -distort arc 120 -write mpr:arc +delete ) \
mpr:image mpr:arc -gravity north -composite combined.jpg
if your text is always the same it would be quicker to create your text and just overlay it each time:
Code: Select all
convert background_image.jpg arc.png -gravity north -composite combined.jpg
Thats the problem when you are trying differnt thingsI managed to get the text to curve but never manage to add it to an image. I cannot find the command I used tough.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Adding arc text to image
Reordering avoids the need for saving the image into a mpr: register.
Also first parenthesis is not needed, as their are no images in memory yet!
the above is basically the 'Arc Compund Font' from
http://www.imagemagick.org/Usage/fonts/
their are lots of other fonts and styles listed.
Contributions for more compound fonts are always welcome!
Also first parenthesis is not needed, as their are no images in memory yet!
Code: Select all
convert background_image.jpg -thumbnail 200x200 \
( -pointsize 20 -fill red -background none label:"Cottenham horse show" \
-virtual-pixel transparent -distort arc 120 ) \
-gravity north -composite combined.jpg
http://www.imagemagick.org/Usage/fonts/
their are lots of other fonts and styles listed.
Contributions for more compound fonts are always welcome!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Adding arc text to image
Hi
Thanks a lot, both the code works. One more thing, when combining the images how do I offset the arc vertically? At the moment the text is being added to the top of the image and I want it about 1/3 the way down.
Regards
Thanks a lot, both the code works. One more thing, when combining the images how do I offset the arc vertically? At the moment the text is being added to the top of the image and I want it about 1/3 the way down.
Regards
Re: Adding arc text to image
You should be able to add a -geometry +0+0 ( +or- horizontal offset +or- vertical offset ) after the -gravity north.