Create titles with border

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
MeDioN

Create titles with border

Post by MeDioN »

Hi there.

I want to generate some titles with border with Imagemagick.
I only find "stroke" to do this, but it's rendering an internal border inside the text:

Code: Select all

convert -size 320x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 \
-draw "text 25,60 'Magick'" -channel RGBA -gaussian 0x6 -fill darkred  \
-draw "text 20,55 'Magick'" fuzzy-magick2.png
Image

The original is there.

Code: Select all

convert -size 320x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 -weight bold \
-draw "text 25,60 'Magick'" -channel RGBA -gaussian 0x6 -fill darkred -stroke magenta  \
-draw "text 20,55 'Magick'" fuzzy-magick.png
Image

Basically the border goes inside.
It's nice there, but when i want to do it on a smaller title, i have this:

Code: Select all

convert -size 320x85 xc:transparent -font "erasbd.ttf" -pointsize 20 \
 -fill yellow -stroke "#000000" \
-draw "text 0,18 'Compendium'" fuzzy-magick.png
Image

And that's not really nice (especially the "e").

So i was wondering if it's possible to do external borders, and if it is, how ?

Any help would be gladly welcomed, thank you.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create titles with border

Post by fmw42 »

MeDioN wrote:Hi there.

I want to generate some titles with border with Imagemagick.
I only find "stroke" to do this, but it's rendering an internal border inside the text:

Code: Select all

convert -size 320x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 \
-draw "text 25,60 'Magick'" -channel RGBA -gaussian 0x6 -fill darkred  \
-draw "text 20,55 'Magick'" fuzzy-magick2.png
Image

The original is there.

Code: Select all

convert -size 320x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 -weight bold \
-draw "text 25,60 'Magick'" -channel RGBA -gaussian 0x6 -fill darkred -stroke magenta  \
-draw "text 20,55 'Magick'" fuzzy-magick.png
Image

Basically the border goes inside.
It's nice there, but when i want to do it on a smaller title, i have this:

Code: Select all

convert -size 320x85 xc:transparent -font "erasbd.ttf" -pointsize 20 \
 -fill yellow -stroke "#000000" \
-draw "text 0,18 'Compendium'" fuzzy-magick.png
Image

And that's not really nice (especially the "e").

So i was wondering if it's possible to do external borders, and if it is, how ?

Any help would be gladly welcomed, thank you.
Redraw your text a second time without the stroke over the first time with the stroke. See the example at http://www.imagemagick.org/Usage/draw/#stroke
MeDioN

Re: Create titles with border

Post by MeDioN »

Just what i have been looking for all the day...
You really save me a lot of time. :)

Many (many many) thanks mate.
Post Reply