Example #1
0
def alias(img,amount): #cheating with a mask
	length, width = bounds(img)
	channel = channels(img)
	post = avail(img)
	mask = [[0,0,0],[255,255,255],[0,0,0],
			[255,255,255],[255,255,255],[255,255,255],
			[0,0,0],[255,255,255],[0,0,0]]
	result = find(img,mask,(3,3))
	return result
Example #2
0
def edge(img):
    avails = avail(img)
    result = like(img).load()
    length, width = bounds(img)
    img = img.load()
    for a in range(0, len(avails)):
        av = avails[a]
        for x in range(0, length):
            for y in range(0, width):
                if av == img[x, y]:
                    result[x, y] == av
    return result
Example #3
0
def edge(img):
	avails = avail(img)
	result = like(img).load()
	length,width = bounds(img)
	img = img.load()
	for a in range(0,len(avails)):
		av = avails[a]
		for x in range(0,length):
			for y in range(0,width):
				if av == img[x,y]:
					result[x,y] == av
	return result
Example #4
0
def alias(img, amount):  # cheating with a mask
    length, width = bounds(img)
    channel = channels(img)
    post = avail(img)
    mask = [
        [0, 0, 0],
        [255, 255, 255],
        [0, 0, 0],
        [255, 255, 255],
        [255, 255, 255],
        [255, 255, 255],
        [0, 0, 0],
        [255, 255, 255],
        [0, 0, 0],
    ]
    result = find(img, mask, (3, 3))
    return result
Example #5
0
channels, crop, scale, color, avail, colorPicker)
from proto import alias, sharpen, group, find, edge, center, distance
from PIL import Image

print "# fast stuff"
img = load('samples/abstract/colors.png')
#b = take()
show(img)
b, g, r = bgr(img)
img = image(b,b,b)
test = like(img)
bound = bounds(b)
channel = channels(b)
coord = (0,0,50,50)
closer = crop(img, coord)
bigger = scale(closer, 2.0)
eyedrop = color(img, 0, 30)
pallet = avail(img)
colorPicker(img,0,30)

print "# slow stuff"
res1 = alias(img, .3)
res2 = sharpen(img, .3)
blob1 = group(img)
mask = Image.new("RGB", (50, 10), "white")
blob3 = find(img,mask,(3,3))
coords1 = edge(img)
coords2 = center(blob1)
dist = distance(0,3)

print "# yay, got to the end!"