Before:
After:
How it works:
The script will iterate over a series of images, breaking each image into a 2D array of its constituent pixel values. A final image will then be generated by calculating the median pixel value across all pixel values at a given position.