Hello folks
I'm trying to create caption text with a textured background used for the text.
I followed the directions here for the Psychedelic! sample:
http://www.imagemagick.org/Usage/text/#annotate_size
However, what i was hoping to accomplish was to create textured text on a fixed canvas width X height so the text would auto resize & center without having to add -pointsize for the caption.
Here is a 600x600 pixel canvas example of what i hope to accomplish.
Texture image
Caption text: WOW this is awesome
The output would be something like this.
Could this be done ? I hope it's possible to accomplish this with imagemagick
Version: ImageMagick 6.7.7-10 2016-11-29 Q16 on Ubuntu
Thanks so much for any help and pointing me in the right direction.
Textured text on fixed width & height canvas
Textured text on fixed width & height canvas
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 | Ubuntu 18.04.1 LTS
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Textured text on fixed width & height canvas
v6.7.7 is very old. I suggest you upgrade.
Windows BAT syntax:
For bash, escape the parentheses to \( and \), and change lines-ends from ^ to \.
Windows BAT syntax:
Code: Select all
%IM%convert ^
texture2.jpg ^
( -clone 0 -fill White -colorize 100 ) ^
( -size 600x600 -gravity center -fill Black ^
caption:"WOW\nthis is\nawesome" ) ^
-composite ^
w.png
snibgo's IM pages: im.snibgo.com
Re: Textured text on fixed width & height canvas
snibgo wrote: ↑2017-02-21T09:02:09-07:00 v6.7.7 is very old. I suggest you upgrade.
Windows BAT syntax:For bash, escape the parentheses to \( and \), and change lines-ends from ^ to \.Code: Select all
%IM%convert ^ texture2.jpg ^ ( -clone 0 -fill White -colorize 100 ) ^ ( -size 600x600 -gravity center -fill Black ^ caption:"WOW\nthis is\nawesome" ) ^ -composite ^ w.png
Thank you so much snibo. It works very well.
I'm just having 1 small final issue. I am using a lot of calligraphy style fonts and the caption in many cases extends beyond the bounding box.
I've looked everywhere and haven't had much luck in solving this.
I've attached an example using the Marguaritas font:
http://www.dafont.com/marguaritas.font
If there was a way to add some padding to the edges, it would be great though.
I will upgrade my version as you advised. Thanks very much.
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 | Ubuntu 18.04.1 LTS
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Textured text on fixed width & height canvas
IM's automatic calculation of the pointzize doesn't work on that font. An upgrade may cure the problem. If it doesn't, you can do an automatic pointsize and find what IM has used, then use (say) 90% of that pointsize, or a larger image size.
snibgo's IM pages: im.snibgo.com
Re: Textured text on fixed width & height canvas
Hi snibgo
Thank you so much for your advise and help! We basically changed the font and all is great. Many Thanks again
Thank you so much for your advise and help! We basically changed the font and all is great. Many Thanks again
Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 | Ubuntu 18.04.1 LTS