Skip to content

Instantly share code, notes, and snippets.

@mbrucher
Created April 4, 2022 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrucher/c511c1a139edaf1059fa4057fa8f4441 to your computer and use it in GitHub Desktop.
Save mbrucher/c511c1a139edaf1059fa4057fa8f4441 to your computer and use it in GitHub Desktop.
Small script to stack astro photos
# -*- coding: utf-8 -*-
import glob
import sys
import numpy as np
from PIL import Image
def readFiles(images):
loaded = [np.asarray(Image.open(img)) for img in images]
return np.array(loaded)
if __name__ == "__main__":
r = np.max(readFiles(glob.glob(sys.argv[1])), axis=0)
Image.fromarray(r).save("result.jpg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment