Skip to content

How to make similar pixels transparent while accounting transparency #238

Answered by snibgo
scarf005 asked this question in General
Discussion options

You must be logged in to vote

I name your images transA.png, transB.png and transExp.png.

transA.png has no ICC colour profile, but the other two do have a profile. Why is that?

transExp.png is entirely red, with varying transparency.

in other words, a + expected = b. now from a.png and b.png, i want to subtract a.png from b.png to get expected (with transparency), ...

Some experimentation shows that you are wrong. Adding transA.png and transExp.png does not give transB.png.

magick transA.png transExp.png -compose Plus -composite x.png

x.png is not the same as `transB.png. Therefore subtracting transA from transB will not give the expected result.

However, using over does work:

magick transA.png transExp.png -compo…

Replies: 0 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@scarf005
Comment options

Answer selected by scarf005
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants