Page 1 of 1

SOLVED - how to ensure blurred text has enough padding?

Posted: 2017-10-19T15:07:15-07:00
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.

Re: how to ensure blurred text has enough padding?

Posted: 2017-10-19T15:39:47-07:00
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.

Re: how to ensure blurred text has enough padding?

Posted: 2017-10-19T15:45:37-07:00
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!

Re: how to ensure blurred text has enough padding?

Posted: 2017-10-19T15:49:03-07:00
by fmw42
Yes, that should also be sufficient.

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

Posted: 2017-10-19T15:56:59-07:00
by teracow