Created
July 10, 2023 13:36
-
-
Save silvio2402/877c57fda4a691e8e8f4c3bef01d401f to your computer and use it in GitHub Desktop.
Blend multiple images in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from PIL import Image | |
def blend_multi(images: list[Image.Image]) -> Image.Image: | |
img_arrs = np.array([np.asarray(img) for img in images]) | |
out = np.mean(img_arrs, axis=0) | |
return Image.fromarray(out.astype(np.uint8)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment