早朝グリッチ。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: Designing Imperfection

Cとアセンブリ言語で学ぶ計算機プログラミングの基礎概念 - プログラムはプロセッサ上でどのように実行されるのか
自分の小さな「箱」から脱出する方法
タオは笑っている (プラネタリー・クラシクス)
SOMABETA COMPILATION
Still Life (Talking)
泥棒
Unix/Linuxプログラミング理論と実践