def process(self, img): import numpy from PIL import Image out = kernels.gaussian_blur_filter( numpy.array(img), sigma=self.n) return Image.fromarray(out) if __name__ == '__main__': from PIL import Image from instakit.utils import static image_paths = map( lambda image_file: static.path('img', image_file), static.listfiles('img')) image_inputs = map( lambda image_path: Image.open(image_path).convert('RGB'), image_paths) for image_input in image_inputs: #image_input.show() #GaussianBlur(n=3).process(image_input).show() Contour().process(image_input).show() Detail().process(image_input).show() Emboss().process(image_input).show() EdgeEnhance().process(image_input).show() EdgeEnhanceMore().process(image_input).show() FindEdges().process(image_input).show() Smooth().process(image_input).show() SmoothMore().process(image_input).show()
def names(cls): return [curve_file.rstrip('.acv') \ for curve_file in static.listfiles('acv') \ if curve_file.lower().endswith('.acv')]
else: self.nY = n def process(self, img): import numpy from PIL import Image out = kernels.gaussian_blur_filter(numpy.array(img), sigma=self.n) return Image.fromarray(out) if __name__ == '__main__': from PIL import Image from instakit.utils import static image_paths = map(lambda image_file: static.path('img', image_file), static.listfiles('img')) image_inputs = map( lambda image_path: Image.open(image_path).convert('RGB'), image_paths) for image_input in image_inputs: #image_input.show() #GaussianBlur(n=3).process(image_input).show() Contour().process(image_input).show() Detail().process(image_input).show() Emboss().process(image_input).show() EdgeEnhance().process(image_input).show() EdgeEnhanceMore().process(image_input).show() FindEdges().process(image_input).show() Smooth().process(image_input).show() SmoothMore().process(image_input).show() Sharpen().process(image_input).show()