Пример #1
0
    def apply(self, info, glyph, image):        
        out = utils.maximum(image, self.kernel)
        
        if self.spread:
            out = fu.blur_image(out, self.spread)
        
        r, g, b, a = fu.split_channels(out)
        
        r[a > 0] = self.color[0]
        g[a > 0] = self.color[1]
        b[a > 0] = self.color[2]
        a[a > 0] = self.opacity

        return fu.alpha_blend(out, image)
Пример #2
0
    def apply(self, info, glyph, image):
        x = int(self.offsetx)
        y = -int(self.offsety)

        shadowbitmap = np.copy( image )
        shadowbitmap = np.roll(shadowbitmap, x, axis = 0)
        shadowbitmap = np.roll(shadowbitmap, y, axis = 1)

        # replace the color
        r, g, b, a = fu.split_channels(shadowbitmap)

        shadowbitmap = np.dstack( (r, g, b, a) ) * (self.color[0], self.color[1], self.color[2], self.opacity)

        shadowbitmap = fu.blur_image(shadowbitmap, self.size)

        topbitmap = np.zeros_like( shadowbitmap )
        topbitmap[:image.shape[0], :image.shape[1], :] = image

        return fu.alpha_blend(shadowbitmap, topbitmap)
Пример #3
0
 def apply(self, info, glyph, image):
     return fu.blur_image(image, self.size)