flrs / blend_modes

Python package that implements image blend modes
MIT License
140 stars 29 forks source link

'Subtract' Blend Does Not Work #19

Closed ghost closed 4 years ago

ghost commented 4 years ago

For some reason Subtract blend mode does not work for me. The result is black or white image. The blending code looks correct:

comp = img_layer_norm[:, :, :3] - img_in[:, :, :3] ratio_rs = np.reshape(np.repeat(ratio, 3), [comp.shape[0], comp.shape[1], comp.shape[2]]) img_out = np.clip(comp ratio_rs + img_in_norm[:, :, :3] (1.0 - ratio_rs), 0.0, 1.0) img_out = np.nan_to_num(np.dstack((img_out, img_in_norm[:, :, 3])))

All other modes work fine. What could be the issue?

m4nuC commented 1 year ago

I am experiencing the same issue, how did you get around it ?