lorcheiro

Untitled

Apr 13th, 2020
359
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from PIL import Image, ImageDraw
  2.  
  3. from math import sin
  4.  
  5. def calc(rx, ry, x, y, d):
  6.     return int(rx*sin(x/d) + ry*sin(y/d))%256
  7.  
  8. m, n, d, rx, ry, gx, gy, bx, by = int(input()), int(input()), int(input()), int(input()), int(input()), int(input()), int(input()), int(input()), int(input())
  9.  
  10. img = Image.new('RGB', (m, n))
  11.  
  12. dib = ImageDraw.Draw(img)
  13.  
  14. for i in range(m):
  15.     for j in range(n):
  16.          dib.point((i, j), (calc(rx, ry, i, j, d), calc(gx, gy, i, j, d), calc(bx, by, i, j, d)))
  17.  
  18. img.save('output.png')
RAW Paste Data