Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. import os
  3. from PIL import Image
  4.  
  5. def img2webp(rutaImagen):
  6. file, ext = os.path.splitext(rutaImagen)
  7. im = Image.open(rutaImagen).convert("RGBA")
  8. im.save(file + ".webp", "WEBP")
  9.  
  10. img2webp(someFilename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement