Delete the alpha from both images, before multiplying them.
You can just turn it off with the 'matte' controls.
That hopefully will solve the problem.
MultiplyCompositeOp behaviour
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: MultiplyCompositeOp behaviour
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: MultiplyCompositeOp behaviour
While reviewing...
As a first draft.
test image...
this reads the image, 'saves' a backup for later reuse.
then separates the alpha channel, and multiplys ALL the channels.
The save image is then used to restore the original alpha.
NOTE: most of the Duff-Porter Compose Methods are defined in terms of pre-multiplied pixels, and Im does this internally. You would only need to do pre-multiplication if you were creating a new composition or something like it.
What Are you planning to use it for? It may already be in IM, or can be added to IM relativally easilly.
As a first draft.
test image...
Code: Select all
convert -size 100x100 gradient: \( +clone -rotate 90% \) \
-compose CopyOpacity -composite test.png
then separates the alpha channel, and multiplys ALL the channels.
The save image is then used to restore the original alpha.
Code: Select all
convert test.png -write MPR:save \
\( +clone -alpha extract \) -compose multiply -composite \
MPR:save -compose DstIn -composite \
pre-multiplied.png
What Are you planning to use it for? It may already be in IM, or can be added to IM relativally easilly.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/