Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong transparency results in some specific cases #22

Open
nico00 opened this issue Jun 21, 2021 · 1 comment
Open

Wrong transparency results in some specific cases #22

nico00 opened this issue Jun 21, 2021 · 1 comment
Labels

Comments

@nico00
Copy link

nico00 commented Jun 21, 2021

In some specific cases I got unexpected behaviours with transparency.
To replicate the problem you can use the attached images (please note that images are 10x10 to better debug the code):
bgr
fgr

and the following code:

import blend_modes
fgr = cv2.imread("fgr.png", cv2.IMREAD_UNCHANGED)
bgr = cv2.imread("bgr.png", cv2.IMREAD_UNCHANGED)
res = blend_modes.multiply(bgr.astype(float), fgr.astype(float), opacity=1.).astype("uint8")
cv2.imwrite("res.png", res)

You will see that expected result (attached), that has been built with PS, is slightly different than the code result.

code_result
expected_result

This problem is happening not only with multiply but also with other modes (normal works properly).

@j05u3
Copy link

j05u3 commented Aug 19, 2021

Is it maybe related to this?

@flrs flrs added the question label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants