Compose modulate creates very dark results

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Compose modulate creates very dark results

Post by tbraber »

In the latest versions (6.7.8.x) I am not able to use the -compose modulate -composite command as in previous versions.

If I use the command:

convert image.jpg watermark.gif -compose modulate -composite test.jpg

The result is a very dark image.
I have tried with -colorspace sRGB and -colorspace RGB in every possible way but could not produce a watermarking like result that worked fine in older versions.

I found out that it worked in versions up to 6.7.6.9 but not in 6.7.8.x . ( could be that 6.7.7.x worked but I did not test that yet)

In the example, the watermark.gif is a grayscale image created with emboss filter with 50% gray level
The image.jpg is a normal sRGB image.

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compose modulate creates very dark results

Post by snibgo »

The documentation (http://www.imagemagick.org/Usage/compose/), discusses only the case where the overlay is black and white, not gray. Perhaps you now need to use the brightness seting. Can you provide samples?

Note that 6.7.8 isn't the latest version.
snibgo's IM pages: im.snibgo.com

tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Re: Compose modulate creates very dark results

Post by tbraber »

Note that 6.7.8 isn't the latest version.
Sorry I meant version 6.8.0-7

Here is an example of a watermark image http://webhop.mediafiler.net/sol/files/ ... ymbol2.gif
Here is an example of the source image http://webhop.mediafiler.net/sol/files/ ... /image.jpg

The modulate option was/is a perfect way to create a watermark as described in the documentation: http://www.imagemagick.org/Usage/compose/#watermark

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compose modulate creates very dark results

Post by snibgo »

It looks to me that ...

Code: Select all

convert image.jpg watermark_symbol2.gif -set colorspace RGB -compose modulate -composite test.jpg
... gives the result that old IM versions did.

This is another consequence of IM generally converting from sRGB to RGB space before doing the required operation. Telling IM that the image is already RGB prevents the conversion.
snibgo's IM pages: im.snibgo.com

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Compose modulate creates very dark results

Post by anthony »

The question is why is it doing that.

The answer is more than likely the nature of how compose modulate works, as it is one of the few compose methods that is colorspace dependant.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Re: Compose modulate creates very dark results

Post by tbraber »

This helped partial, but now the image has dark edges around the watermark and dark spots if the image contains white parts.
See example: http://webhop.mediafiler.net/sol/files/ ... ertest.jpg or http://webhop.mediafiler.net/sol/files/ ... _6aa55.jpg

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compose modulate creates very dark results

Post by snibgo »

"-compose modulate composite" seems to work okay in v6.8.5 but not 6.8.6.
snibgo's IM pages: im.snibgo.com

tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Re: Compose modulate creates very dark results

Post by tbraber »

I am testing in version 6.8.5 at the moment and there the dark edges and clipping pixels appear. This was working correct in version 6.7.6.9

snibgo
Posts: 12904
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compose modulate creates very dark results

Post by snibgo »

Sorry, I should have supplied exact version numbers:

6.8.5-0 "-compose modulate composite" seems to work

6.8.5-8 "-compose modulate composite" creates black pixels where either image was white

6.8.6-0 as for 6.8.5-8

All on Windows 7.

I don't know exactly what modulate is supposed to do, but the black pixels are really ugly and obviously (I think) a bug.
snibgo's IM pages: im.snibgo.com

User avatar
magick
Site Admin
Posts: 11217
Joined: 2003-05-31T11:32:55-07:00

Re: Compose modulate creates very dark results

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.6-2 Beta available by sometime tomorrow. Thanks.

tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Re: Compose modulate creates very dark results

Post by tbraber »

I have tested with version 6.8.6-2 Q16 this version still has the same problem.

User avatar
magick
Site Admin
Posts: 11217
Joined: 2003-05-31T11:32:55-07:00

Re: Compose modulate creates very dark results

Post by magick »

We get http://www.imagemagick.org/watermark.jpg. Identify the problem with this result.

tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Re: Compose modulate creates very dark results

Post by tbraber »

In your image there are also some black dots in places where they should be white. Best is to test with a light image that contains some full white (255,255,255) dots.
They will become black then.
This is the same image but with IM version 6.7.7 http://webhop.mediafiler.net/sol/files/ ... _405ac.jpg

User avatar
magick
Site Admin
Posts: 11217
Joined: 2003-05-31T11:32:55-07:00

Re: Compose modulate creates very dark results

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.6-3 Beta available by sometime tomorrow. Thanks.

tbraber
Posts: 9
Joined: 2012-12-05T02:03:43-07:00
Authentication code: 6789

Re: Compose modulate creates very dark results

Post by tbraber »

SOLVED: Tested with 6.8.6-3 and Modulate works again as good as it did in older versions.

Thanks.

Post Reply