fork(2) download
  1. from PIL import Image
  2.  
  3. im = Image.new('RGB', (3600, 3600))
  4. pi = im.load()
  5. pi1 = Image.open('pic1.png').load()
  6. pi2 = Image.open('pic2.png').load()
  7.  
  8. for i in range(3600):
  9. for j in range(3600):
  10. if 5 <= i % 12 <= 6 and 5 <= j % 12 <= 6:
  11. r, g, b = map(lambda t: int(t * 0.796875 + 0.5), pi1[(i // 12, j // 12)])
  12. pi[(i,j)] = (r, g, b)
  13. if i % 45 == 22 and j % 45 == 22:
  14. pi[(i,j)] = pi2[(i // 45, j // 45)]
  15.  
  16. im.save('pic.png', optimize=True)
Runtime error #stdin #stdout #stderr 0.13s 11848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 5, in <module>
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2248, in open
    fp = builtins.open(fp, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'pic1.png'