flrs / blend_modes

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

fix not deleted nan from _compose_alpha #18

Closed UPML closed 5 years ago

UPML commented 5 years ago

Fix bug with not deleted nan. If you insert

    ratio[ratio == np.NAN] = 0.0
    assert not np.isnan(ratio).any()

12 of 24 tests will be failed. ratio[ratio == np.NAN] = 0.0 doesn't delete nans? We should use ratio = np.nan_to_num(ratio) instead.

flrs commented 5 years ago

Thanks, @UPML, this is a valid bug and a great fix! I will merge it into dev and then release it to master.