Page 1 of 1

Posted: 2007-01-07T09:31:53-07:00
by Bonzo
I can not think of an easy way to do it. One way would be to make an image containing your text and use that to watermark your image.

One thing I have noticed and that is if you use a transparent background the text does not come out very well.
Anyway if nothing else is suggested you can probably have a play around with this and see if you can improve on it.

Code: Select all

<?php

exec("/usr/local/bin/convert -size 250x60 xc:none -font verdana.ttf -fill black -pointsize 40 -gravity center -draw \" text 0,0 'rubblewebs' \" transparent.gif");

exec("/usr/local/bin/composite -gravity center -dissolve 30% transparent.gif earth.jpg watermark_transparent.jpg");

unlink ( "transparent.gif" );

?>

Posted: 2007-01-07T11:25:53-07:00
by el_supremo
Would this sort of thing do what you want?:

Code: Select all

convert logo: -pointsize 36 -font Times-New-Roman -fill rgba(100%,0,0,0.3) -gravity southwest -annotate +0+0 "Hello Wizards Everywhere!" logo_sig.jpg
rgba sets the colour to pure red and the alpha to 0.3

Note to the wizards: changing the gravity to southeast or northeast chops off the exclamation mark. If I change the string to "Hello Wizards Everywhere!a" then it prints the full string.

Pete

Posted: 2007-01-07T12:32:12-07:00
by magick
Looks like the we need a -2 offset for a gravity of NorthEast. We'll investigate and add a patch to ImageMagick 6.3.1-7 Beta. Thanks.

Posted: 2007-01-07T13:23:25-07:00
by Bonzo
Interesting el_supremo; trouble is I have not had a lot to do with graphics and still do not understand the different colour specifications along with masks and transparency!

I have tested your code and it works Ok for me using both northeast & southeast.

Version: ImageMagick 6.2.8

Posted: 2007-01-07T14:41:07-07:00
by el_supremo
I should have said what version I was using too: 6.3.1 12/24/06 Q8

Pete

Posted: 2007-01-07T16:32:14-07:00
by anthony
One thing I have noticed and that is if you use a transparent background the text does not come out very well.
Anyway if nothing else is suggested you can probably have a play around with this and see if you can improve on it.


Of course text does not come out very well if you use GIF to hold it!

GIF only has boolean transparency, That is it is on, or off. no semi-transparency.
Use PNG or MIFF for th eintermediate image. The former is more compressed and very well known.