今日もグリッチ
import Image,sys
from random import randint
file = sys.argv[1]
im = Image.open(file)
width,height = im.size
interval = 0
for h in range(height):
if(interval == 0):
interval = randint(0,height-1)
rand_slide_x = randint(0,14)
rand_slide_y = randint(0,4)
slide_x = 0
slide_y = 0
else:
interval -= 1
slide_x += rand_slide_x
slide_y += rand_slide_y
for w in range(width):
current = (w,h)
new_h = h + slide_y
new_w = w + slide_x
if new_h >= height: new_h = h
if new_w >= width: new_w = w
src = (new_w,new_h)
im.putpixel(current,im.getpixel(src))
im.show()
im.save("glitch091021.jpg")