From 1d4560cf3642dacc77e55539513c13c140ec2fbf Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 14 Jan 2023 16:24:46 -0600 Subject: [PATCH] fix blend, use mask as mult --- api/onnx_web/image.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/onnx_web/image.py b/api/onnx_web/image.py index c1e5f484..e897adf3 100644 --- a/api/onnx_web/image.py +++ b/api/onnx_web/image.py @@ -14,9 +14,9 @@ def blend_imult(a): def blend_mask_inverse_source(source: Tuple[int, int, int], mask: Tuple[int, int, int], noise: Tuple[int, int, int]) -> Tuple[int, int, int]: return ( - int((source[0] * blend_imult(noise[0])) + (mask[0] * blend_mult(noise[0]))), - int((source[1] * blend_imult(noise[1])) + (mask[1] * blend_mult(noise[1]))), - int((source[2] * blend_imult(noise[2])) + (mask[2] * blend_mult(noise[2]))), + int((source[0] * blend_imult(mask[0])) + (noise[0] * blend_mult(mask[0]))), + int((source[1] * blend_imult(mask[1])) + (noise[1] * blend_mult(mask[1]))), + int((source[2] * blend_imult(mask[2])) + (noise[2] * blend_mult(mask[2]))), )