diff --git a/methods/bulk_methods.py b/methods/bulk_methods.py index 01deb97..20b1a00 100644 --- a/methods/bulk_methods.py +++ b/methods/bulk_methods.py @@ -5,9 +5,7 @@ import numpy as np def edge(file_name): image = Image.open(file_name) - image = image.convert("L") - return image.filter(ImageFilter.FIND_EDGES) @@ -19,6 +17,16 @@ def canny_edge(file_name): return Image.fromarray(feature.canny(image, sigma=2)) +def blur(file_name): + image = Image.open(file_name) + return image.filter(ImageFilter.BLUR) + + +def grayscale(file_name): + image = Image.open(file_name) + return image.convert("L") + + def sharpen(file_name): image = Image.open(file_name) return image.filter(ImageFilter.SHARPEN) @@ -28,6 +36,8 @@ methods_funcs = { "Sharpen": sharpen, "Edge detection": edge, "Canny edge detection": canny_edge, + "Grayscale": grayscale, + "Blur": blur, } methods = list(methods_funcs.keys())