Drkcore

21 10 2009 Python PIL glitch Tweet

昼下がりグリッチ

今日もグリッチ

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")

1256101630

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021