Skip to content

Commit

Permalink
fix(api): premultiply noise before compositing
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 17, 2023
1 parent 4aeee60 commit b496e71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/onnx_web/image.py
Expand Up @@ -179,7 +179,8 @@ def expand_image(

full_mask = mask_filter(mask_image, dims, origin)
full_noise = noise_source(source_image, dims, origin)
# TODO: multiply noise by mask before compositing
full_noise = ImageChops.multiply(full_noise, full_mask)

full_source = Image.composite(full_noise, full_source, full_mask.convert('L'))

return (full_source, full_mask, full_noise, (full_width, full_height))

0 comments on commit b496e71

Please sign in to comment.