Drkcore

06 05 2011 life Python Tweet

サケグリッチ

日本酒のラベルでグリッチ。幾つか出してみてヨサゲな画像にgimpでポスタリゼーションとトーンカーブかけた。

joukigen

import base64,re,Image
from random import randint

def glitch(infile,outfile):
    jpg_text = base64.encodestring(open(infile,"rb").read())
    glitched_text = ""
    width,height = Image.open(infile).size
    num = width * height / 10000
    for c in jpg_text:
        if c == '0':
            if randint(0,num) == 0:
                count += 1
                glitched_text += str(randint(0,9))
            else:
                glitched_text += c
        else:
            glitched_text += c
    glitched_jpg = base64.decodestring(glitched_text)
    open(outfile,"wb").write(glitched_jpg)
    return ""

もうちょっとノイズを加えたほうがいいかな。

ProductName Glitch: Designing Imperfection

Mark Batty Publisher / 2508円 ( 2009-09-16 )


About

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

Tag

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

Ad

© kzfm 2003-2021