Skip to content

Instantly share code, notes, and snippets.

@guoyoujin
Created March 26, 2019 03:02
Show Gist options
  • Save guoyoujin/0dfafc3532ebf41e69cf7c064bac08b9 to your computer and use it in GitHub Desktop.
Save guoyoujin/0dfafc3532ebf41e69cf7c064bac08b9 to your computer and use it in GitHub Desktop.
图片转换成webp格式
//pip3 install Pillow
import os
from PIL import Image
//
path = "/Users/apple/Desktop/captcha_20190325"
tagerPath = "/Users/apple/Desktop/webcaptcha_20190325/"
files= os.listdir(path)
for file in files:
if not os.path.isdir(file):
im = Image.open(path+"/"+file)
im.save(tagerPath + file, "WEBP")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment