Text with gradient stroke?
Re: Text with gradient stroke?
Thanks rmabry,
that was what I thought too, but its not working, do you've another idea?
cheers
froesi
that was what I thought too, but its not working, do you've another idea?
cheers
froesi
Re: Text with gradient stroke?
Not without the exact command and error message.froesi wrote: that was what I thought too, but its not working, do you've another idea?
But I cannot even run the command you posted without escaping the parentheses AND putting spaces around them.
On the other hand, the Linux system I am using is way out of date for ImageMagick (6.3.2), so mine fails (with no error message) for other reasons.
Rick
Re: Text with gradient stroke?
Hi,
I've version (6.4.0.4) and mine fails too. (with no error message).
thats the code.
thanks
I've version (6.4.0.4) and mine fails too. (with no error message).
thats the code.
Code: Select all
convert -size 1024x768 xc:white -font Helvetica -pointsize 80 \( -size 20x80 gradient:#FFFF00-#ff0000 -write mpr:grad -fill mpr:grad \) -strokewidth 5 -draw "text 20,80 'GRADSTROKE'" -delete 1 wallpaper_test.jpg
thanks
Re: Text with gradient stroke?
Hmm, this works (except that I gave it a different font):froesi wrote:mine fails too. (with no error message).Code: Select all
convert -size 1024x768 xc:white -font Helvetica -pointsize 80 \( -size 20x80 gradient:#FFFF00-#ff0000 -write mpr:grad -fill mpr:grad \) -strokewidth 5 -draw "text 20,80 'GRADSTROKE'" -delete 1 wallpaper_test.jpg
Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -write mpr:grad \) -fill mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 gradstroke.png
Rick
Re: Text with gradient stroke?
Damn, nope, that was a stupid copy& paste error. I've
I forgot the -fill, the point is, that I want the gradient at the stroke.
Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -write mpr:grad \) -fill #FFD505 -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 gradstroke.png
Re: Text with gradient stroke?
You don't tell us what is wrong. But I get an error (convert: no encode delegate for this image format `-fill'.) unless I put the color in quotes (-fill "#FFD505") or escape the # symbol (-fill \#FFD505).froesi wrote:Damn, nope, that was a stupid copy& paste error. I've
I forgot the -fill, the point is, that I want the gradient at the stroke.Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -write mpr:grad \) -fill #FFD505 -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 gradstroke.png
Rick
Re: Text with gradient stroke?
Thanks Rick, now I got the gradient, but I've my old problem, that the whole gradient won't be created as a single new image, and that the script starts at point y:0 to start for the gradient.
Now I have this line:
I want the text as a stroke -> the stroke should have the gradient.
Over the stroke I put the Text again.
Now I have this line:
Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -write mpr:grad \) -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 -fill \#FFFF00 -stroke none -draw "text 20,80 GRADSTROKE" gradstroke.png
Over the stroke I put the Text again.
Re: Text with gradient stroke?
[edit] Sorry for the second post, but the server was down
Thanks Rick, now I got the gradient, but I've my old problem, that the whole gradient won't be created as a single new image, and that the script starts at point y:0 to start for the gradient.
Now I have this line:
I want the text as a stroke -> the stroke should have the gradient.
Over the stroke I put the Text again.
Thanks Rick, now I got the gradient, but I've my old problem, that the whole gradient won't be created as a single new image, and that the script starts at point y:0 to start for the gradient.
Now I have this line:
Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -write mpr:grad \) -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 -fill \#FFFF00 -stroke none -draw "text 20,80 GRADSTROKE" gradstroke.png
Over the stroke I put the Text again.
Re: Text with gradient stroke?
I'm not too clear on what you mean here about a "single new image". The gradient below is indeed a new image.froesi wrote:Thanks Rick, now I got the gradient, but I've my old problem, that the whole gradient won't be created as a single new image, and that the script starts at point y:0 to start for the gradient.
And I don't understand "the script starts at point y:0".
I wonder if you mean that you want to change the point at where the tiling starts. If so, try adding "-tile-offset +x+y" (where you choose x and y) to effectively roll the tile. (You can also use -roll in place of -tile-offset to change the intermediate file itself; -tile-offset just causes an offset to be added, so that the pixels are read from a different spot. In this situation, I think -roll -x-y and -tile-offset +x+y are equivalent, with -tile-offset being generally more efficient.)
Okay. And with the above, the stroke DOES have the gradient, doesn't it? Sorry to seem dense. If possible, maybe you can attach a "hand-drawn" version of what you want.Now I have this line:
I want the text as a stroke -> the stroke should have the gradient.Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -write mpr:grad \) -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 -fill \#FFFF00 -stroke none -draw "text 20,80 GRADSTROKE" gradstroke.png
Over the stroke I put the Text again.
Anyway, play with the parameter in -tile-offset below to see if that can be used to get what you want.
Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 \( -size 20x20 gradient:#FFFF00-#ff0000 -tile-offset +0+10 -write mpr:grad \) -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 -fill \#FFFF00 -stroke none -draw "text 20,80 GRADSTROKE" gradstroke.png
Re: Text with gradient stroke?
Thank you Rick for your help,
I tried this, but i won't work. It seems like the gradient is put over the whole image, not only over the text.
Here again the code I use.
that's how it should look like:
And here are some test where the text has a different position:
I hope now you'll know what I mean
thanks
I tried this, but i won't work. It seems like the gradient is put over the whole image, not only over the text.
Here again the code I use.
Code: Select all
convert -size 1024x768 xc:white -draw 'affine 1,0,0,1,6,77 image Over 0,0 0,0 "bg.jpg"' -font FontName -pointsize 26 \( -size 20x60.359415458679 gradient:#FFFF00-#ff0000 -tile-offset +212.910275+123.908375 -write mpr:grad \) -stroke mpr:grad -strokewidth 8 -draw 'affine 2.2777137908936,0,0,2.2777137908936,212.910275,123.908375 text 5,26.52 "GRADSTROKE" ' -delete 1 -fill #FFFF00 -stroke none -draw 'affine 2.2777137908936,0,0,2.2777137908936,212.910275,123.908375 text 5,26.52 "GRADSTROKE" ' -draw 'affine 1,0,0,1,0,0 image Over 0,0 0,0 "mask.png"' image.jpg 2>&1
And here are some test where the text has a different position:
I hope now you'll know what I mean
thanks
Re: Text with gradient stroke?
I'm confused by that statement because the code I posted above gives the following.froesi wrote: I tried this, but i won't work. It seems like the gradient is put over the whole image, not only over the text.
The gradient is indeed only over the text. (I believe our terminology is clashing.) Here it is for Windows, so you'd need to escape the (, #, ),:
Code: Select all
-size 600x100 xc:white -font Helvetica -pointsize 80 ( -size 20x20 gradient:#FFFF00-#ff0000 -tile-offset +0+10 -write mpr:grad ) -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 -fill #FFFF00 -stroke none -draw "text 20,80 GRADSTROKE" gradstroke.png
Of course I realize you want the period of the gradient to match the height of the text. You could adjust the size of the period: (I've used a slightly different method that doesn't affect the discussion. Notice that the size of the text is 63 pixels; this is a problem with this method --- you have to measure it.)
Code: Select all
convert -size 600x100 xc:white -font Helvetica -pointsize 80 -fill #ffff00 ( -size 1x63 gradient:#FFFF00-#ff0000 -tile-offset +0-20 -write mpr:grad ) -stroke mpr:grad -strokewidth 5 -draw "text 20,80 GRADSTROKE" -delete 1 gradstroke2.png
You can move the text if you adjust the offset: (I moved the text down 15 pixels and did llikewise for the offset.)
Code: Select all
-size 600x100 xc:white -font Helvetica -pointsize 80 -fill #ffff00 ( -size 1x63 gradient:#FFFF00-#ff0000 -tile-offset +0-35 -write mpr:grad ) -stroke mpr:grad -strokewidth 5 -draw "text 20,95 GRADSTROKE" -delete 1 gradstroke3.png
But I cannot test that, as I don't have your images "bg.jpg" or "mask.png". But no matter...Here again the code I use.
You tell me! Maybe I'm getting warm.I hope now you'll know what I mean
Rick
Re: Text with gradient stroke?
Thank you Rick for your answer,
it's not working:
Why do I cant say, write the gradient, then write again an internal image, where the text lies at point 0,0 --> put there the gradient into the stroke und all these image together put back into the big one at a certain position?
the problem is, if the text moves somewhere else in the image, you have to change the offset value too, I cant do that dynamicly in an easy way. The size of the textfont is changing too.
like you wrote, when you change the y value of your text you need to change the offset again.
cheers froesi
it's not working:
Why do I cant say, write the gradient, then write again an internal image, where the text lies at point 0,0 --> put there the gradient into the stroke und all these image together put back into the big one at a certain position?
the problem is, if the text moves somewhere else in the image, you have to change the offset value too, I cant do that dynamicly in an easy way. The size of the textfont is changing too.
like you wrote, when you change the y value of your text you need to change the offset again.
cheers froesi
Re: Text with gradient stroke?
Right you are. That's what scripts are for. If you can manage Perl/PerlMagick or some other scripting language, you can probably do anything you wish. Otherwise, fonts are royal pain. Having to mess with pointsize makes it difficult to know the image sizes. You can avoid pointsize using the label: pseudotype bu then you can't use tiles! Maybe that will change one day.froesi wrote:Why do I cant say, write the gradient, then write again an internal image, where the text lies at point 0,0 --> put there the gradient into the stroke und all these image together put back into the big one at a certain position?
the problem is, if the text moves somewhere else in the image, you have to change the offset value too, I cant do that dynamicly in an easy way. The size of the textfont is changing too.
like you wrote, when you change the y value of your text you need to change the offset again.
I hope you've looked at Anthony's advice on all this:
http://www.imagemagick.org/Usage/text/#size
One of the best bits of advice he gives is this: "Basically you can't really win, in all situations, just try your best."
If I think of anything else (that probably won't work), I'll let you know!
Rick