Skip to content

Instantly share code, notes, and snippets.

@silvio2402
Created July 10, 2023 13:36
Show Gist options
  • Save silvio2402/877c57fda4a691e8e8f4c3bef01d401f to your computer and use it in GitHub Desktop.
Save silvio2402/877c57fda4a691e8e8f4c3bef01d401f to your computer and use it in GitHub Desktop.
Blend multiple images in python
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