Page 1 of 1

Making watermarked image

Posted: 2010-01-02T12:04:45-07:00
by paulchany
Hi,

I'm trying to make a watermarked image using as 'overly' image 'trans195.gif' and as background image 'transparentbackground.png'.
The trans195.gif image is RGB image with dimensions 100x100 px.

I created in GIMP this empty, grayscale transparentbackground.png image and it's dimensions are 100x100 px.

I'm trying the following command to get the watermarked.png:

Code: Select all

$ composite -watermark 30% trans195.gif transparentbackground.png watermarked.png
but then I get an empty image. :(
Why?

Re: Making watermarked image

Posted: 2010-01-02T13:18:25-07:00
by fmw42
Can you post a link to your images? I am not sure if that works if either or both images have transparency. I would need to try and might as well use your images.

try without the %

see http://www.imagemagick.org/Usage/compose/#watermark

also what version of IM are you using?


Tests on IM 6.5.8-10 Q16 with my own images seem to indicate that if the background is totally transparent, the result will be totally transparent. If the background is gray and the overlay image is partially transparent, then I get a grayscale version of the overlay with its transparency in tact.

So the bottom line appears to be that -watermarking is not amenable to transparent images.

Re: Making watermarked image

Posted: 2010-01-03T01:52:17-07:00
by paulchany
Here is the link for the transparentbackground.png image:
http://www.archive.org/download/Transpa ... ground.png
Here is the link for the trans195.gif image:
http://www.astrologyweekly.com/images/moon/trans195.gif
I'm using 'ImageMagick 6.3.7 08/07/09 Q16 ' on Debian GNU/Linux Lenny.

I try the command without %:

Code: Select all

composite -watermark 30 trans195.gif transparentbackground.png watermarked.png
but get the same empty image.

Actually here is what I want: I want to get a watermarked image of the 'trans195.gif' with dimensions say: 600x600 px and use it on my webpage as a background image. This image is the actual Moon phase.
So my script should run every 4 hour to download the trans195.gif and convert it to a watermarked image for background of my webpage. :)
Here is my script so far:

Code: Select all

#!/bin/sh

# before download it, if exist, remove the previous downloaded trans195.gif image
if test -f trans195.gif* 2> /dev/null
then rm trans195.gif*
fi

# download the trans195.gif
wget http://www.astrologyweekly.com/images/moon/trans195.gif

# convert the image with imagemagick in to PNG format
convert trans195.gif -emboss 0.0,0.6 -resize 600% -colorize 0,0,50 Holdfazis.png

# make a watermarked image from it
composite -watermark 5% Holdfazis.png graybackground.png HoldfazisVizjel.png

# colorize the image
convert -colorize 0,0,50 HoldfazisVizjel.png Holdfazis.png
The link of graybackground.png is here:
http://www.archive.org/download/GrayBac ... ground.png
Running the script I get a very bad watermarked image of the actual Moon phase. :(
How can I get better result?

Re: Making watermarked image

Posted: 2010-01-03T15:34:22-07:00
by fmw42
I don't think watermarking works with transparent images per my earlier message.

I think what you want to do is composite the two images together with composite -dissolve and some attenuation of the overlay image to make it faint.

Please put a link to your web page background image and where you want to put the overlay image.


Try this (you can adjust the dissolve and change the 30 to make it stronger or weaker)

composite -dissolve 30x100 -gravity center trans195.gif graybackground.png graybackground_trans195_d30x100.png

Is this what you want? If not please show an example or explain further.

Re: Making watermarked image

Posted: 2010-01-04T03:25:51-07:00
by paulchany
I think what you want to do is composite the two images together with composite -dissolve and some attenuation of the overlay image to make it faint.
Yes, thank you, I want that.
Please put a link to your web page background image and where you want to put the overlay image.
the link of the overly black/white image: http://www.archive.org/download/TreeOfLife/eletfa.png
the link of the not transparent, white background image: http://www.archive.org/download/backgro ... attere.png
One can't see anything here because it's a white image filled out with white color.
I tried your command ( :) thanks!):

Code: Select all

composite -dissolve 10x100 -gravity center eletfa.png eletfahattere.png eletfahatterkep.png
and get what I want:
the link of the faint, background image for my website: http://www.archive.org/download/Backgro ... terkep.png