I've been using IM for a long time to draw text on images, usually in the form: -fill '#ffffff' -pointsize 20 -draw "rotate 45 text 100,100 'This is text'"
I've been having trouble with special characters and unicode, so, I thought I could just put the text in a file and access with @filename,
but that doesn't seem to work with -draw
Looking at the text examples here: http://www.imagemagick.org/Usage/text
there are a lot of options for drawing text, but each seems not support all the features? (like position)
So, I'm wondering what's draw the text.. should I just use draw and programmatically escape all the special characters?
Adding text to images.. confused..
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Adding text to images.. confused..
Yeah, we are spoilt for choice, but it is confusing.
You can put the entire draw argument in a text file, eg ...
... where draw.txt contains ...
You can put the entire draw argument in a text file, eg ...
Code: Select all
"%IMG%convert" -size 500x500 xc: -draw @draw.txt d.png
Code: Select all
rotate 45 text 100,100 'This is text'
snibgo's IM pages: im.snibgo.com
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Adding text to images.. confused..
You can also use -annotate with @filename argument method.
This has no extra quotes to deal with and when reading from a file the text is literal, so no further escapes.
You can specify size and offset for the text placement.
See Annotate
http://www.imagemagick.org/Usage/text/#annotate
This has no extra quotes to deal with and when reading from a file the text is literal, so no further escapes.
You can specify size and offset for the text placement.
See Annotate
http://www.imagemagick.org/Usage/text/#annotate
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/