Page 1 of 1
[solved] Blurred text cut off around edges: Best way to fix?
Posted: 2016-09-29T20:07:46-07:00
by mhulse
Hello,
My code:
Code: Select all
convert \
-background none \
-pointsize 500 \
-gravity center \
-fill black \
-interline-spacing -30 \
-blur 0x16 \
label:"${utility.addBreaks('This is my super duper cool title that is long', 5)}" \
${shared.dirFiles}${shared.dirCover}title.png
What would be the best way to avoid the blur from being cut off?
Thanks!
Code: Select all
Version: ImageMagick 6.9.5-10 Q16 x86_64 2016-09-21 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
Re: Blurred text cut off around edges: Best way to fix?
Posted: 2016-09-29T20:28:11-07:00
by GeeMack
mhulse wrote:What would be the best way to avoid the blur from being cut off?
First thing I'd try there is adding a border of at least the size of your blur, maybe even a few pixels more. Add that border after you make the label, and do your blur operation after that.
Code: Select all
... label:"Label Words" -bordercolor none -border 20x20 -blur 0x16 ...
Re: Blurred text cut off around edges: Best way to fix?
Posted: 2016-09-29T20:56:40-07:00
by mhulse
GeeMack wrote:mhulse wrote:What would be the best way to avoid the blur from being cut off?
First thing I'd try there is adding a border of at least the size of your blur, maybe even a few pixels more. Add that border after you make the label, and do your blur operation after that.
Code: Select all
... label:"Label Words" -bordercolor none -border 20x20 -blur 0x16 ...
Ahhhhh, that did it! Thanks so much GeeMack, I really appreciate the help!!!!!
Here's my complete example (please let me know if this could be optimized or if I am doing something wrong/oddly):
Code: Select all
convert \
-background none \
-font "${shared.dirFonts}Roboto Condensed/RobotoCondensed-Regular.ttf" \
-pointsize 500 \
-gravity Center \
-interline-spacing -30 \
-bordercolor none \
-strokewidth 16 \
\\( \
-border 200x200 \
-stroke black \
label:"${title}" \
-blur 0x32 \
\\) \
\\( \
-border 200x200 \
-stroke none \
-fill white \
label:"${title}" \
\\) \
-flatten \
+repage \
${shared.dirFiles}${shared.dirCover}title.png
Note: The above is used in a JavaScript template literal string, hence the double backslashes.
End result:
I love ImageMagick!!!!!
Thanks again GeeMack!!!
Re: Blurred text cut off around edges: Best way to fix?
Posted: 2016-09-29T21:51:30-07:00
by GeeMack
mhulse wrote:Here's my complete example (please let me know if this could be optimized or if I am doing something wrong/oddly):
I think both of your "-border" operations should come immediately after creating each label. It might work the way you have it, but normally you'd want to put that border around something that already exists. A version update, adding other operations to the label, or migrating to IM7 could possibly break your code the way you have it.
Code: Select all
...
-stroke ... \
-fill ... \
label: ... \
-border ... \
-blur ... \
...
Re: Blurred text cut off around edges: Best way to fix?
Posted: 2016-09-30T21:48:50-07:00
by mhulse
GeeMack wrote:
I think both of your "-border" operations should come immediately after creating each label. It might work the way you have it, but normally you'd want to put that border around something that already exists. A version update, adding other operations to the label, or migrating to IM7 could possibly break your code the way you have it.
Ah, great catch! I moved the -border operation to after the label and it works exactly the same. Thank you for the tip(s), I greatly appreciate it!!!!
Have an awesome weekend GeeMack!