Open nico00 opened 3 years ago
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):
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.
This problem is happening not only with multiply but also with other modes (normal works properly).
Is it maybe related to this?
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):
and the following code:
You will see that expected result (attached), that has been built with PS, is slightly different than the code result.
This problem is happening not only with multiply but also with other modes (normal works properly).