示例#1
0
    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()
示例#2
0
 def names(cls):
     return [curve_file.rstrip('.acv') \
         for curve_file in static.listfiles('acv') \
         if curve_file.lower().endswith('.acv')]
示例#3
0
        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()
示例#4
0
 def names(cls):
     return [curve_file.rstrip('.acv') \
         for curve_file in static.listfiles('acv') \
         if curve_file.lower().endswith('.acv')]