Watermark with Text
Watermark with Text
Hi, I'm trying to watermark an image with text, but I'm struggling to get this done. I've read many blogs online, including http://www.imagemagick.org/Usage/annotating/#wmark_text ...but my watermark is just not coming out correctly.
My main problem is that my watermark seems to have a background that is visible (though somewhat lightened) even after the "composite" command...The first command DOES create a watermark. And the second command DOES put the watermark on the image...but I can't get it to look correct...like an embossed/watermarked text on the image...
I'm using ASP.NET, but I'm basically just using a shell command from there.
Here's my code:
convert -size 300x50 xc:grey30 -background transparent -font Arial -pointsize 20 -gravity center -draw "fill white text 1,1 'Tequipment.net' text 0,0 'Tequipment.net' fill black text -1,-1 'Tequipment.net' " +matte WATERMARK_FILE.png
composite -dissolve 50% -gravity south WATERMARK_FILE.png INPUT_IMAGE OUTPUT_IMAGE
I've also tried -watermark 30%, instead of -dissolve 50%, in the composite command...plus MANY OTHER THINGS.
I've tried playing with the first command:
-background none instead of -background transparent
-xc:white and xc:black instead of xc:grey30
Please help! I really need to get this working already.
Thanks in advance!
My main problem is that my watermark seems to have a background that is visible (though somewhat lightened) even after the "composite" command...The first command DOES create a watermark. And the second command DOES put the watermark on the image...but I can't get it to look correct...like an embossed/watermarked text on the image...
I'm using ASP.NET, but I'm basically just using a shell command from there.
Here's my code:
convert -size 300x50 xc:grey30 -background transparent -font Arial -pointsize 20 -gravity center -draw "fill white text 1,1 'Tequipment.net' text 0,0 'Tequipment.net' fill black text -1,-1 'Tequipment.net' " +matte WATERMARK_FILE.png
composite -dissolve 50% -gravity south WATERMARK_FILE.png INPUT_IMAGE OUTPUT_IMAGE
I've also tried -watermark 30%, instead of -dissolve 50%, in the composite command...plus MANY OTHER THINGS.
I've tried playing with the first command:
-background none instead of -background transparent
-xc:white and xc:black instead of xc:grey30
Please help! I really need to get this working already.
Thanks in advance!
Re: Watermark with Text
THis should work:
I have just noticed that if you put the logo over a transparent part of a png it shows a background.
When you say embossed were you looking to achive this effect?
Code: Select all
convert -size 300x50 xc:none -font Arial -pointsize 20 -gravity center -draw \"fill white text 1,1 'Tequipment.net' text 0,0 'Tequipment.net' fill black text -1,-1 'Tequipment.net' \" WATERMARK_FILE.png
composite -dissolve 50% -gravity south WATERMARK_FILE.png INPUT_IMAGE OUTPUT_IMAGE
When you say embossed were you looking to achive this effect?
Re: Watermark with Text
Yes, thank you. That worked! Thank you!
Here's a sample:
But, I would prefer something prettier like the rubbleheads sample above...Is there any slight modifications to size/font/etc to make my watermark more pleasant and professional? Though I don't want something too big, because I think my company will want it 'tiled.'
Thanks again so much for your quick response!
Here's a sample:
But, I would prefer something prettier like the rubbleheads sample above...Is there any slight modifications to size/font/etc to make my watermark more pleasant and professional? Though I don't want something too big, because I think my company will want it 'tiled.'
Thanks again so much for your quick response!
Re: Watermark with Text
I am glad it worked and I have some php watermark examples on my site including an example of tiling which you could convert: http://www.rubblewebs.co.uk/imagemagick/watermark.php
There are other watermarking ideas on Anthony's site: http://www.imagemagick.org/Usage/annota ... termarking
If you have any other code questions please post your code between the "Code" tags as as it is easier to read.
There are other watermarking ideas on Anthony's site: http://www.imagemagick.org/Usage/annota ... termarking
If you have any other code questions please post your code between the "Code" tags as as it is easier to read.
There are so many options with Imagemagick and it will work with all ttf fonts - you can space the letters more with -kerning to allow for any drop shadows etc.Is there any slight modifications to size/font/etc
Re: Watermark with Text
Hi, thanks for all your help.
I tried copying the code you have for the nice embossed look in the sample (of the flower) you included above. Here's my code:
But this is what I'm getting:
(does not look embossed, and not the same font as yours)
I tried copying the code you have for the nice embossed look in the sample (of the flower) you included above. Here's my code:
Code: Select all
convert -size 450x200 -background none -font Utopia-bold -fill white -gravity center caption:"Tequipment.net" -shade 240x40 WATERMARK_FILE.png
(does not look embossed, and not the same font as yours)
Re: Watermark with Text
I'm now trying to use the annotate command, since I want my text to be angled & tiled. So, here's what I have:
And here's the image:
But, i need to be able to use the fill commands like I do with the draw command...
...so that you can see the watermark over dark images & light images.
But, I don't want it to be QUITE so bold...I really like the embossed look...
Code: Select all
convert -size 400x200 xc:none -font Arial -pointsize 30 -kerning 2 -gravity center -fill rgba(0,0,0,0.4) -annotate 315x315+0+0 "Tequipment.net" WATERMARK_FILE.png
But, i need to be able to use the fill commands like I do with the draw command...
Code: Select all
-draw \"fill white text 1,1 'Tequipment.net' text 0,0 'Tequipment.net' fill black text -1,-1 'Tequipment.net' \"
But, I don't want it to be QUITE so bold...I really like the embossed look...
Re: Watermark with Text
OK, I got it to work to my boss's desire...so no need to answer anything in this post.
Here's my current code for anyone else who's looking at this...
Here's my current code for anyone else who's looking at this...
Code: Select all
convert -size 400x200 xc:none -font Arial -pointsize 25 -kerning 1 -gravity center -fill black -annotate 330x330+0+0 "Tequipment.net" -fill white -annotate 330x330+2+2 "Tequipment.net" WATERMARK_FILE.png
composite -dissolve 20% -tile WATERMARK_FILE.png INPUT_FILE OUTPUT_FILE
Re: Watermark with Text
Sorry to anyone who's looking at this -- I see I used the same image url each time I played with it...so looking now at the older posts (besides the last one) is not actually how it looked when I commented on it...
Re: Watermark with Text
Good result, to use a different font you can use any true type font and you either need to put it in the same folder as your code or provide the path to the font. I think some fonts give better results in this case - probably "chunkier" fonts are best.
To list the fonts imagemagick knows about use either of the codes below depending on your version:
I assume you can run some php code on your server and there is an example of how to get a graphical output of the fonts here: http://www.rubblewebs.co.uk/imagemagick ... /fonts.php
To list the fonts imagemagick knows about use either of the codes below depending on your version:
Code: Select all
convert -list font
or
convert -list type
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Watermark with Text
It is posible to do the tiling in a single "convert" command. It is just not a simple 'option' at this time.
Tiling with a in-memory image...
http://www.imagemagick.org/Usage/canvas/#tile_memory
Tiling with a in-memory image...
http://www.imagemagick.org/Usage/canvas/#tile_memory
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/