by pretentious on Tue Oct 01, 2013 6:05 am
([msg=77536]see Re: Cracking Simple Image Codes Using Python[/msg])
I've had your code on my HDD just waiting to be played with. Here's something completely different i put together
- Code: Select all
from PIL import Image
import sys
import time
img = Image.open(sys.argv[1])
tiles = int(sys.argv[2])
img = img.convert("RGB")
pixdata = img.load()
for y in range(0, img.size[1], (img.size[1]/tiles)):
for x in range(0, img.size[0], (img.size[0]/tiles)):
#print x, y
red = 0
green = 0
blue = 0
cells = 0
for yi in range(y, (y+(img.size[1]/tiles)),1):
for xi in range(x, (x+(img.size[0]/tiles)),1):
cells = cells + 1
pixel = pixdata[xi, yi]
red = red + pixel[0]
green = green + pixel[1]
blue = blue + pixel[2]
for yi in range(y, (y+(img.size[1]/tiles))):
for xi in range(x, (x+(img.size[0]/tiles))):
pixdata[xi, yi] = (red/cells,green/cells,blue/cells)
img.show()
I'm in love with pythons simple API's. This takes an image and effectively pixelates it. I wanted to achive a proper bluring effect by making the squares bleed into each other but had other stuff to do. Anyone want to pick up where i left off?
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.
IF you feel like exchanging ASCII arrays, let me know

Can you say brainwashing It's a non stop disco