Page 1 of 1
Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-11T10:59:58-07:00
by alex_nb
Hello,
I'm trying to make work an application developed on a server that has version 6.3.7.9 (Debian Lenny package) on my desktop that has version 6.4.5.4 (Ubunty Jaunty Jackalope) and imagemagick is behaving differently.
That's the operation I'm doing:
convert '(' 'res.jpg' '-modulate' '100,0,100' 'resMask.png' '-matte' '-compose' 'DstIn' '-composite' ')' '(' 'res.jpg' '-fill' '#FF69CF' '-colorize' '100%' ')' '-compose' 'multiply' '-composite' 'mainBg.png' '+compose' '-composite' '-quality' '85' out.jpg
That's the (correct) output on the old version 6.3.7.9:
While that's the wrong output on 6.4.5.4 (and newer, I tested also version 6.5.1.0 in Debian unstable):
I suppose that in the new version there is some bug in the handling of the alpha channel, otherwise anyone can help me understand how I can revert to the old behavior?
For reference, the images used in the example are available here:
http://nb1.nibbles.it/imagemagick/regre ... mainBg.png (image with alpha channel)
http://nb1.nibbles.it/imagemagick/regre ... .4/res.jpg ("main" image)
http://nb1.nibbles.it/imagemagick/regre ... esMask.png ("mask" image, using alpha channel too)
Thanks for any help!
Alex
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-11T22:09:09-07:00
by anthony
Can you break up the command steps to discover where it is going 'different'?
I can't guarantee that we will change it back, as it may be that something was fixed to work 'correctly' but resulted in you command not doing what you expect.
We may need some source images as well so we can try out the steps ourselves.
Remember we need to be able to repeat your steps to help you solve the problem.
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-11T22:21:00-07:00
by alex_nb
Remember we need to be able to repeat your steps to help you solve the problem.
Hello Anthony,
I've attached all the source images, you should be able to repeat the operation without any problem, please tell me if you need something else.
As for breaking down the steps I'm not expert enough to understand how to do it but I'll try...
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-12T01:41:20-07:00
by alex_nb
A first problem seems to arise in the first step, the "modulate".
Just doing the following command gives a different result between the two versions:
convert 'res.jpg' '-modulate' '100,0,100' 'resMask.png' out.jpg
In particular this is the output in version 6.3.7.9:
while this is the output on the current version:
For the record I repost the links to the images used for the test:
http://nb1.nibbles.it/imagemagick/regre ... .4/res.jpg
http://nb1.nibbles.it/imagemagick/regre ... esMask.png
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-12T02:36:22-07:00
by alex_nb
Ok, the biggest problem is in the last part of the process, I tracked it down to this:
convert res.jpg mainBg.png +compose -composite out.jpg
That gives two completely different results, this is the old one (correct, at least for what we use it
):
i.e.: the image is "masked" following the alpha channel of mainBg.png
while this the output in the newer versions of imagemagick:
i.e.: the image is left untouched
I suppose this is a bug, otherwise it's a big change in behavior and I would be very pleased to know how to manage to obtain the same result in current version of imagemagick
Thanks!
Alex
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-12T09:31:51-07:00
by fmw42
Not an expert on this but try:
convert res.jpg mainBg.png +compose -compose over -composite out.jpg
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-12T11:59:16-07:00
by alex_nb
Thanks for your hint, this seems to work!
Should this be considered a regression anyway?
Or should it be documented the new behavior of some commands or the different defaults?
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-12T19:46:34-07:00
by anthony
Replace +compose with -compose over
The +compose means use the compose stored in the images matedata.
It no longer means default to over.
This was to allow more correct handling of -flatten with photoshop layers
As for modulate I note in the Change log...
2008-04-20 6.4.0-10 Chris Madison <madisonblu@hotma...>
* Default to HSL colorspace when modulating (reference
viewtopic.php?f=1&t=11073).
but also Remember this discussion....
viewtopic.php?t=12640
which showed the problems modulate had when using HSL.
I myself have not noted any difference in modulates results. but then I don't have a lot of examples of using it.
Modulate Brightness, Saturation, and Hue
http://www.imagemagick.org/Usage/color/#modulate
Re: Regression from 6.3.7.9 to 6.4.5.4 and newer in complex op
Posted: 2009-05-12T23:59:02-07:00
by alex_nb
Thanks to everybody for the explanations, I think I solved all the problems.
Sorry for having overlooked the changelogs, I'll try to do my best in the future