Page 1 of 1

Can Image magic create an outline around text?

Posted: 2016-07-20T10:30:55-07:00
by questorfla
If so, is there a command-line method of doing this?
I have searched everywhere for a true TTF font with more than one color but so far, no luck.
I use ImageMagick command line tools already in a batch to do things that normally took multiple open, edit, close functions
and would be delighted to find a way to handle this.
For instance, taking a line of text, adding a red or blue Halo effect, then converting to png.
Or even convert to png as black on white background then add the halo.
the end product has to be a png file anyway

Thanks for any suggestions There are so many ways to do things in ImageMagick that sometimes I think it really is Magick!

Re: Can Image magic create an outline around text?

Posted: 2016-07-20T10:40:20-07:00
by snibgo

Re: Can Image magic create an outline around text?

Posted: 2016-07-20T10:43:58-07:00
by GeeMack
questorfla wrote:For instance, taking a line of text, adding a red or blue Halo effect, then converting to png.
Or even convert to png as black on white background then add the halo.
That sort of thing is frequently done by using "-annnotate" twice, something like this (using ImageMagick 7 on Windows 7 64)...

Code: Select all

magick -size 400x100 xc:none -pointsize 36 -fill white -stroke blue -strokewidth 4 -gravity center ^
   -annotate +0+0 "Your Text Here" -blur 0x3 -stroke none -annotate +0+0 "Your Text Here" result.png
Do it without the "-blur" for an outline instead of a halo. You could "-trim" the result and add a transparent "-border" of a few pixels to get rid of the excess canvas.

Re: Can Image magic create an outline around text?

Posted: 2016-07-20T12:21:07-07:00
by fmw42
If on Unix (Linux, Mac OSX or Windows with Cygwin or Windows 10), see my scripts texteffect and texteffect2 at the link below.

P.S. Outline fonts do exist, but they are b/w and not two-colors