Hi.
I'm looking to add a watermark but kipping the alpha of the bitmap.
I'm currently use this command
composite -dissolve 50% -gravity SouthEast watermark.png airship.png airship1.png
It give me this result.
http://www.webshaker.net/airship1.png
But what I'd like to have is
http://www.webshaker.net/airship2.png
i.e. not have the watermark on transparent pixels.
That must not be difficult for someone who know how to use imagemagick, but for me...
Thank's
add a watermark but not on transparent pixels
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: add a watermark but not on transparent pixels
what does your watermark image look like -- does it have the text all over it? If so create a mask from the other image and use that to limit the text for the watermark image before compositing or white compositing.
If you post your two input image, we can try to give you the commands.
If you post your two input image, we can try to give you the commands.
Re: add a watermark but not on transparent pixels
oups sorry.
I was not clear...
my watermark image is
http://www.webshaker.net/watermark.png
my image source is
http://www.webshaker.net/airship.png
what I want is
http://www.webshaker.net/airship2.png
Thx
Etienne
I was not clear...
my watermark image is
http://www.webshaker.net/watermark.png
my image source is
http://www.webshaker.net/airship.png
what I want is
http://www.webshaker.net/airship2.png
Thx
Etienne
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: add a watermark but not on transparent pixels
try this
# read airship
# read watermark and crop to southeast corner
# extract the alpha channel of the airship image as a mask
# dissolve the airship and the cropped watermark using the mask to limit the watermark
convert airship.png \
\( watermark.png -gravity southeast -crop 256x256+0+0 +repage \) \
\( -clone 0 -alpha extract \) \
-compose dissolve -define compose:args=50,100 -composite \
airship3.png
see
http://www.imagemagick.org/script/compose.php
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#dissolve
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#clone
This is unix. If on windows, see difference such as no \ escape on parens and end of line escape change from \ to ^. see http://www.imagemagick.org/Usage/windows/
# read airship
# read watermark and crop to southeast corner
# extract the alpha channel of the airship image as a mask
# dissolve the airship and the cropped watermark using the mask to limit the watermark
convert airship.png \
\( watermark.png -gravity southeast -crop 256x256+0+0 +repage \) \
\( -clone 0 -alpha extract \) \
-compose dissolve -define compose:args=50,100 -composite \
airship3.png
see
http://www.imagemagick.org/script/compose.php
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#dissolve
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#clone
This is unix. If on windows, see difference such as no \ escape on parens and end of line escape change from \ to ^. see http://www.imagemagick.org/Usage/windows/