SOLVED - how to ensure blurred text has enough padding?

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
User avatar
teracow
Posts: 19
Joined: 2013-04-30T02:55:12-07:00
Authentication code: 6789
Location: Brisbane, Australia

SOLVED - how to ensure blurred text has enough padding?

Post by teracow »

Hello,

I'm using:

Code: Select all

$ convert -version
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
... on Debian Stretch 9.1

Problem: the left-side of the image cuts off the nice blurred shadow behind the yellow title text. When I then add this title image onto another image, the obvious vertical line looks bad.

This is the finished product:
Image

Please note for the images below:
  • the dark border is not the image - it's the background of my image viewer (purposely captured during screenshot).
  • the checkerboard is the transparent background.

Code: Select all

$ convert -size x100 -font Century-Schoolbook-L-Bold-Italic -background none -stroke black -strokewidth 10 label:"abcdefg" -blur 0x5 -fill goldenrod1 -stroke none label:"abcdefg" -flatten "gallery.title.png"
Image

I tried adding a border but it didn't work how I thought: :(

Code: Select all

$ convert -size x100 -font Century-Schoolbook-L-Bold-Italic -background none -stroke black -strokewidth 10 label:"abcdefg" -blur 0x5 -fill goldenrod1 -stroke none label:"abcdefg" -border 20 -flatten "gallery.title.png"
Image

How can I get the blurred background shadow text (and then the foreground text) to start rendering more to the right??

Thank you.
Last edited by teracow on 2017-10-19T15:52:31-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to ensure blurred text has enough padding?

Post by fmw42 »

try this (adding space to the left and right)

Code: Select all

convert -size x100 -font Century-Schoolbook-L-Bold-Italic -background none -stroke black -strokewidth 10 label:"\n abcdefg \n" -blur 0x5 -fill goldenrod1 -stroke none label:"\n abcdefg \n" -flatten "gallery.title.png"
Increase the size if you want it taller to adjust for it being longer text.
User avatar
teracow
Posts: 19
Joined: 2013-04-30T02:55:12-07:00
Authentication code: 6789
Location: Brisbane, Australia

Re: how to ensure blurred text has enough padding?

Post by teracow »

Ah, good thinking Fred. That should have occurred to me. :D

I found this does what I want:

Code: Select all

convert -size x100 -font Century-Schoolbook-L-Bold-Italic -background none -stroke black -strokewidth 10 label:"\ abcdefg" -blur 0x5 -fill goldenrod1 -stroke none label:"\ abcdefg" -flatten "gallery.title.png"
Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to ensure blurred text has enough padding?

Post by fmw42 »

Yes, that should also be sufficient.
User avatar
teracow
Posts: 19
Joined: 2013-04-30T02:55:12-07:00
Authentication code: 6789
Location: Brisbane, Australia

Re: SOLVED - how to ensure blurred text has enough padding?

Post by teracow »

Post Reply