Python PIL.ImageFilter 模块,EMBOSS 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用PIL.ImageFilter.EMBOSS

项目:IV    作者:collinmutembei    | 项目源码 | 文件源码
def apply_effects(image, effects):
    """method to apply effects to original image from list of effects
    """
    for effect in effects:
        gray = ImageOps.grayscale(image)
        # dictionary with all the availble effects
        all_effects = {
            'BLUR': image.filter(ImageFilter.BLUR),
            'CONTOUR': image.filter(ImageFilter.CONTOUR),
            'EMBOSS': image.filter(ImageFilter.EMBOSS),
            'SMOOTH': image.filter(ImageFilter.SMOOTH),
            'HULK': ImageOps.colorize(gray, (0, 0, 0, 0), '#00ff00'),
            'FLIP': ImageOps.flip(image),
            'MIRROR': ImageOps.mirror(image),
            'INVERT': ImageOps.invert(image),
            'SOLARIZE': ImageOps.solarize(image),
            'GREYSCALE': ImageOps.grayscale(image),

        }
        phedited = all_effects[effect]
        image = phedited
    return phedited
项目:plumeria    作者:sk89q    | 项目源码 | 文件源码
def emboss(message, im):
    """
    Applies a emboss effect.

    Example::

        /drawtext Hello there! | emboss

    Requires an input image.
    """
    return im.filter(ImageFilter.EMBOSS)