Page 2 of 2

Re: change in "compose -multiply" from IM 6.2 to 6.3?

Posted: 2008-03-14T04:14:43-07:00
by anthony
Why are you even using multiply?

Multiply is a special purpose composition operator, it isn't meant to be used in the way you are using it.

What you are probably wanting is the default 'Over' Alpha Composition method. See IM Examples, Alpha Composition
http://imagemagick.org/Usage/compose/

Re: change in "compose -multiply" from IM 6.2 to 6.3?

Posted: 2008-03-14T09:34:34-07:00
by adamschneider
I used "multiply" because that's what Photoshop and other GUI graphic applications call it!

Re: change in "compose -multiply" from IM 6.2 to 6.3?

Posted: 2008-03-15T05:32:09-07:00
by anthony
Applogies. I was a little rushed at the time I was last looking.

Using a 6.3.8 image magick (I am a sub-version behind the latest at this point) I did the following...

Code: Select all

convert triangle_white.png \
     \( +clone +matte -matte -fill red -colorize 100% \) \
     -compose multiply -composite -scale 1000% miff:- | display
The second line generates a pure red canvas image (with alpha channel)
to compose the original image against.
The result was a red image with a balck triangle. No transparency at all.

This is what I would have expected from the Mathematical compose operators which never really properly defined what they should do about the matte/alpha channel of the image.

However taking our the "+matte -matte" parts of the above command results in something similar to what you were after.

A red inside and transparent outside. However it isn't quite right either. For some reason the semi-transparent pixels were also tinted read too!!!

That did not make any sense at all unless those semi-transparent pixels were not semi-transparent black as I would expect. So I decided to check the original image, but overlaying it on pure black.

Code: Select all

convert triangle_white.png -background black -flatten \
      -scale 1000% miff:- | display
YEAP. your semi-transparent pixels are a semi-transparent gray!!!!
In other words your original image is probably not exactly what you think it is.

I'll see about getting the very latest version of IM, and trying the above again to see if I can repeat the original problem, you reported.