projekty
/
imago.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catching keyboard interrupt
[imago.git]
/
filters.py
diff --git
a/filters.py
b/filters.py
index
c2648ea
..
825834f
100644
(file)
--- a/
filters.py
+++ b/
filters.py
@@
-1,6
+1,9
@@
-from PIL import Image
+from PIL import Image
, ImageFilter
def edge_detection(image):
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 = image.load()
new_image = Image.new('L', image.size)
new_image_l = new_image.load()
@@
-11,7
+14,7
@@
def edge_detection(image):
image_l[a, b]
for b in range(y - 2, y + 3)])
for a in range(x - 2, x + 3)])
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:
if pix > 255:
pix = 255
if pix < 0: