Skip to content

Commit fdd70ad

Browse files
committed
with np.errstate(invalid="ignore", divide="ignore"):
1 parent b872cee commit fdd70ad

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

blendmodes/blend.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,17 @@ def blendLayersArray(
610610
BlendType.DESTATOP: destatop,
611611
}
612612

613-
if blendType in alphaFunc:
614-
out_rgb, out_alpha = alphaFunc[blendType](lower_alpha, upper_alpha, lower_rgb, upper_rgb)
615-
else:
616-
out_rgb, out_alpha = alpha_comp_shell(
617-
lower_alpha, upper_alpha, lower_rgb, upper_rgb, blendType
618-
)
613+
with np.errstate(invalid="ignore", divide="ignore"):
614+
if blendType in alphaFunc:
615+
out_rgb, out_alpha = alphaFunc[blendType](
616+
lower_alpha, upper_alpha, lower_rgb, upper_rgb
617+
)
618+
else:
619+
out_rgb, out_alpha = alpha_comp_shell(
620+
lower_alpha, upper_alpha, lower_rgb, upper_rgb, blendType
621+
)
619622

620-
return np.nan_to_num(np.dstack((out_rgb, out_alpha)), copy=False) * 255.0
623+
return np.nan_to_num(np.dstack((out_rgb, out_alpha)), copy=False) * 255.0
621624

622625

623626
def alpha_comp_shell(

0 commit comments

Comments
 (0)