2009/10/20 14:24:51
PILでglitch
早朝グリッチ。PILのputpixelは遅いので、1.1.6からはim.loadを使えとのこと。
import Image,sys
from random import randint
file = sys.argv[1]
im = Image.open(file)
width,height = im.size
slide_x = 0
slide_y = 0
rand_slide_x = randint(0,14)
rand_slide_y = randint(0,4)
pix = im.load()
for h in range(height):
slide_x += rand_slide_x
slide_y += rand_slide_y
for w in range(width):
new_h = h + slide_y
new_w = w + slide_x
if new_h >= height: new_h = h
if new_w >= width: new_w = w
pix[w,h] = pix[new_w,new_h]
im.show()
im.save("glitch091020.jpg")
そしてGlitch: Perfet Imperfectionsもポチッた
Glitch: Perfet ImperfectionsIman Moradi,Ant Scott,Joe Gilmore,Christopher Murphy
Mark Batty Pub / ¥ 3,105 ()
通常1~3週間以内に発送
参考