lomolive.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:wx-fancy-pic 作者: Lavande 项目源码 文件源码
def lomoize (image,darkness,saturation):

    (width,height) = image.size

    max = width
    if height > width:
        max = height

    mask = Image.open("./lomolive/lomomask.jpg").resize((max,max))

    left = round((max - width) / 2)
    upper = round((max - height) / 2)

    mask = mask.crop((left,upper,left+width,upper + height))

#   mask = Image.open('mask_l.png')

    darker = ImageEnhance.Brightness(image).enhance(darkness)   
    saturated = ImageEnhance.Color(image).enhance(saturation)
    lomoized = Image.composite(saturated,darker,mask)

    return lomoized
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号