21 lines
460 B
Python
Executable File
21 lines
460 B
Python
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i python3 -p "python3.withPackages (ppkgs: with ppkgs; [ pillow numpy ])"
|
|
|
|
from PIL import Image
|
|
import numpy as np
|
|
|
|
def main():
|
|
with Image.open("scrambled1.png") as im:
|
|
img1 = np.asarray(im)
|
|
|
|
with Image.open("scrambled2.png") as im:
|
|
img2 = np.asarray(im)
|
|
|
|
result_array = img1 + img2
|
|
result = Image.fromarray(result_array)
|
|
result.save('out.png')
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|