Python图片处理

  1. Python图像处理库PIL基本使用
    #将图片转换为灰度图像
    

    from PIL import Image
    pil_im = Image.open('cat.jpg')
    gray_cat = pil_im.convert('L')
    gray_cat.save('gray-cat.png')
    #  然后得到的灰猫
    

    # 图片缩略
    pil_im2.thumbnail((128,128))
    pil_im2.show()
    


分享个检测非法图片的小脚本,不过误报率还是比较高

https://github.com/bcho/porn-image-detect
原文地址:https://www.cnblogs.com/evilxr/p/4208753.html