-from PIL import Image
+from PIL import Image, ImageFilter
def edge_detection(image):
+ image = image.filter(ImageFilter.GaussianBlur())
+ # GaussianBlur is undocumented class, it might not work in future versions
+ # of PIL
image_l = image.load()
new_image = Image.new('L', image.size)
new_image_l = new_image.load()
image_l[a, b]
for b in range(y - 2, y + 3)])
for a in range(x - 2, x + 3)])
- - (25 * image_l[x, y]))
+ - (25 * image_l[x, y]))
if pix > 255:
pix = 255
if pix < 0: