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/
change in "compose -multiply" from IM 6.2 to 6.3?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: change in "compose -multiply" from IM 6.2 to 6.3?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: change in "compose -multiply" from IM 6.2 to 6.3?
I used "multiply" because that's what Photoshop and other GUI graphic applications call it!
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: change in "compose -multiply" from IM 6.2 to 6.3?
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...
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.
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.
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
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
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/