A collection of Python generated art.

 

import os
import re
from PIL import Image
import shutil
import random

class imageInfo:
	def __init__(self):
		print 'image info running'
		size = 512, 512
		im = Image.open('C:\_Files\image\\horn.jpg')
		for o in range(1):
			#im.thumbnail(size, Image.ANTIALIAS)
			for i in range(im.size[0]):
				for j in range(im.size[1]):
					co = im.getpixel((i,j))
					#im.putpixel((i,j), co[0])

					if (co[2]< 20 ):

						for u in range(100):
							#im.putpixel((i,j), ((co[0]- u, co[1] - u, co[2]-u)))

							try:
								t=u%25

								c0 = co[0] + (t)
								c1 = co[1] + (t)
								c2 = co[2] + (t)

								if c0> 255:
									c0=random.randint(1,255)
								if c1> 255:
									c1=random.randint(1,255)
								if c2> 255:
									c2=random.randint(1,255)

								im.putpixel((i+random.randint(1,4), (j+random.randint(1,4)) ), (c0,c1,c2))

								#im.putpixel((i, (j+(u)) ), ((co[0] - (u*10)  ), co[1]-(u*10), co[2]-(u*10)))

								#im.putpixel((i,j+u), ((255,0,0)))
							except:
								pass
			newFileNameRandom = random.randint(1,100000)
			im.save('C:\_Files\image\diskmagg_' + str(newFileNameRandom) + str(o) + '.jpg', "JPEG")

imageInfo()
print 'program complete'

Comments are closed.