partial transparency lost in composite -watermark
Posted: 2012-08-14T18:28:00-07:00
Hi,
The "composite -watermark" command is not respecting the partial transparency of my PNG watermark.
I'm using ImageMagick 6.7.7-8 2012-06-20 Q16 (i.e., latest version) on Windows 2008.
Source JPG:
http://www.cuttingedgephotography.co.uk ... source.jpg
Partially-transparent PNG watermark:
http://www.cuttingedgephotography.co.uk ... ermark.png
Command:
composite -watermark 50% -gravity southeast watermark.png source.jpg output.jpg
This is what I get:
http://www.cuttingedgephotography.co.uk ... output.jpg
It seems that ImageMagick is ignoring my alpha transparency in my PNG, so any pixel that has any colour at all -- as long as it is not fully transparent -- is treated as a solid grey.
I have read about using -dissolve instead, and that gives me what I want:
http://www.cuttingedgephotography.co.uk ... lve_50.jpg
I'd like to know why it is not working with -watermark and/or if there is any workaround. From http://www.imagemagick.org/Usage/annota ... mark_image : "Before IM version 6, the options "-watermark" and "-dissolve" were broken with their handling of the alpha channel (transparency) for the overlaying image, producing some very strange effects". Perhaps this is fixed for -dissolve but still broken for -watermark? I guess I'll probably switch to "-dissolve" but I have a image-hosting framework where thousands of customers have built watermarks for use with "-watermark" and changing everything is risky. I'd like to at least know the full story. From the docs, it sounds like "-watermark" is *supposed* to support partial transparency.
Thanks,
Matt
The "composite -watermark" command is not respecting the partial transparency of my PNG watermark.
I'm using ImageMagick 6.7.7-8 2012-06-20 Q16 (i.e., latest version) on Windows 2008.
Source JPG:
http://www.cuttingedgephotography.co.uk ... source.jpg
Partially-transparent PNG watermark:
http://www.cuttingedgephotography.co.uk ... ermark.png
Command:
composite -watermark 50% -gravity southeast watermark.png source.jpg output.jpg
This is what I get:
http://www.cuttingedgephotography.co.uk ... output.jpg
It seems that ImageMagick is ignoring my alpha transparency in my PNG, so any pixel that has any colour at all -- as long as it is not fully transparent -- is treated as a solid grey.
I have read about using -dissolve instead, and that gives me what I want:
http://www.cuttingedgephotography.co.uk ... lve_50.jpg
I'd like to know why it is not working with -watermark and/or if there is any workaround. From http://www.imagemagick.org/Usage/annota ... mark_image : "Before IM version 6, the options "-watermark" and "-dissolve" were broken with their handling of the alpha channel (transparency) for the overlaying image, producing some very strange effects". Perhaps this is fixed for -dissolve but still broken for -watermark? I guess I'll probably switch to "-dissolve" but I have a image-hosting framework where thousands of customers have built watermarks for use with "-watermark" and changing everything is risky. I'd like to at least know the full story. From the docs, it sounds like "-watermark" is *supposed* to support partial transparency.
Thanks,
Matt