I was trying to use:
magick composite "pattern.png" -compose Multiply "green.png" "mrp3.png"
what is wrong for RGB channels, only alpha channel has correct A amount, than I tested if it would work for only grayscale and for only one channel( R ) and it worked, as expected.
RGBA Images Mulitply(Not Wowking):
Result :
magick composite "pattern_0.png" -compose Multiply "channels_0.png" "channelpattern.png"
Grayscale Images(Working)
Result
I am frustraded how to get multiply to work independtly for each Channel.
-compose Multiply not wroking with RGBA files
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -compose Multiply not wroking with RGBA files
What version of ImageMagick? What platform/OS?
magick composite is not as flexible as just magick for doing compositing. You should start using that.
Your pattern image has transparency. So you should be using -compose copy_opacity -composite with magick using its alpha channel and putting that alpha channel into the alpha channel of the green image.
Unix syntax:
Window syntax:
If you really want multiply, then
or
Since the alpha channel is the same as the pattern image base channels.
But then the result will have a black background.
magick composite is not as flexible as just magick for doing compositing. You should start using that.
Your pattern image has transparency. So you should be using -compose copy_opacity -composite with magick using its alpha channel and putting that alpha channel into the alpha channel of the green image.
Unix syntax:
Code: Select all
magick green.png \( pattern.png -alpha extract \) -alpha off -compose copy_opacity -composite result.png
Code: Select all
magick green.png ( pattern.png -alpha extract ) -alpha off -compose copy_opacity -composite result.png
Code: Select all
magick green.png \( pattern.png -alpha extract \) -compose multiply -composite result.png
Code: Select all
magick green.png \( pattern.png -alpha off \) -compose multiply -composite result.png
But then the result will have a black background.
Re: -compose Multiply not wroking with RGBA files
thanks for the answer, I somehow fixed that issue by using instead of the RGBA mask only an Grayscale mask, it than multiplies per channel as imo it should always.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: -compose Multiply not wroking with RGBA files
I'm not sure exactly what result you're trying to achieve, but there are several ways to composite the alpha channel from one image onto another. Fred described a common method using "-alpha extract" and "-alpha off -compose copy_opacity" above. Here is a command that uses a different compose method to get pretty much the same result...raabik wrote: ↑2019-04-11T13:10:04-07:00I was trying to use:
magick composite "pattern.png" -compose Multiply "green.png" "mrp3.png"
what is wrong for RGB channels, only alpha channel has correct A amount, than I tested if it would work for only grayscale and for only one channel( R ) and it worked, as expected.
Code: Select all
magick green.png pattern.png -compose copyalpha -composite result.png