Hello there,
I was searching around and it seems that gradient fill only works for -annotate and not for caption:?
I was wondering if it's possible to apply a gradient fill to text created with caption:
Thank you.
Question about caption:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Question about caption:
Gradient fill is not a direct option for caption:. But you can do it with more in the command line by creating a gradient after the fact and then composing the text over the gradient. Try (unix syntax)
or
See http://www.imagemagick.org/Usage/canvas ... _gradients
Please always provide your IM version and platform, since syntax may differ
Code: Select all
convert -size 256x -pointsize 64 -background none \
-fill red -font Arial -gravity center caption:"Testing" \
\( -clone 0 -alpha opaque -sparse-color Barycentric '0,0 black %[fx:w-1],0 white' \) \
+swap -compose over -composite caption_gradient_background.png
or
Code: Select all
convert -size 256x -pointsize 64 -background none -fill red -font Arial -gravity center caption:"Testing" \
\( -clone 0 -alpha opaque -sparse-color Barycentric '0,0 black %[fx:w-1],0 white' \) \
-compose dstover -composite caption_gradient_background.png
Please always provide your IM version and platform, since syntax may differ
Re: Question about caption:
Hello, thanks for response.
I apologize for not being more precise, I meant is it possible to apply a gradient to text using caption?
For example, the word testing to go from black to white like how it is in the second example in the following link: http://www.imagemagick.org/Usage/fonts/
From what I gathered, it seems to only work with annotate.
Thanks again.
P.S. IM version: ImageMagick 6.9.1-0 Platform: Linux
I apologize for not being more precise, I meant is it possible to apply a gradient to text using caption?
For example, the word testing to go from black to white like how it is in the second example in the following link: http://www.imagemagick.org/Usage/fonts/
From what I gathered, it seems to only work with annotate.
Thanks again.
P.S. IM version: ImageMagick 6.9.1-0 Platform: Linux
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Question about caption:
Not directly. But this works for me (by creating a mask of the text and compositing it to control the mix of the gradient and the background)
Code: Select all
convert -size 256x -pointsize 64 -background black \
-fill white -font Arial -gravity center caption:"Testing" \
\( -clone 0 -alpha opaque -sparse-color Barycentric '0,0 black %[fx:w-1],0 white' \) \
\( -clone 0 -alpha opaque -fill red -colorize 100 \) \
-reverse -compose over -composite caption_gradient.png
Re: Question about caption:
Hmm that looks about right... would it be possible though to have the gradient go vertically and if the background can be transparent?
Thank you.
Thank you.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Question about caption:
Code: Select all
convert -size 256x -pointsize 64 -background black \
-fill white -font Arial -gravity center caption:"Testing" \
\( -clone 0 -alpha opaque -sparse-color Barycentric '0,0 black 0,%[fx:h-1], white' \) \
\( -clone 0 -alpha transparent \) \
-reverse -compose over -composite caption_gradient2.png
Re: Question about caption:
Hello, that is great! Thanks!
I tried to add a stroke to it but doing the following but no results.. is it possible to add stroke?
As always, thank you again!
I tried to add a stroke to it but doing the following but no results.. is it possible to add stroke?
Code: Select all
convert -size 256x -pointsize 64 -background black -fill white -font Arial -stroke yellow -strokewidth 2 -gravity center caption:"Testing" \( -clone 0 -alpha opaque -sparse-color Barycentric '0,0 black 0,%[fx:h-1], white' \) \( -clone 0 -alpha transparent \) -reverse -compose over -composite caption_gradient2.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Question about caption:
It is possible, but not directly. It gets even more complicated. But you might take a look at my texteffect script at the link below. For example:
The script does not wrap text however. So it is more like label: than caption:
Code: Select all
texteffect -t "SOME GRADIENT TEXT" -s outline -e normal -f Arial -p 48 \
-c red-blue -b none -o yellow -l 3 -u none -A 0 gradient_outline_text.png
The script does not wrap text however. So it is more like label: than caption: