Watermarking problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
life24
Posts: 22
Joined: 2016-02-19T00:31:25-07:00
Authentication code: 1151

Watermarking problem

Post by life24 »

Hello,
How can watermark a color image inside a gray scale image?
Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Watermarking problem

Post by fmw42 »

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

It does not matter if one image is gray and the other is color (either way)

Code: Select all

convert grayimage colorimage -compose dissolve \ 
-define compose:args={src_percent},{dst_percent} \ 
-composite result
life24
Posts: 22
Joined: 2016-02-19T00:31:25-07:00
Authentication code: 1151

Re: Watermarking problem

Post by life24 »

Thank you,but i think after your solution,grayscale image will be colorful.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Watermarking problem

Post by fmw42 »

If you put a color watermark on a grayscale image, the result must be sRGB and not grayscale, since there is some color in the picture. You cannot keep the result as grayscale.

If you want a grayscale result, either add -colorspace gray at the end before the output or use a grayscale version of the watermark image
Post Reply