seroff

webptojpg by seroff (python)

Aug 20th, 2022
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #Transfer all images to the program and get jpg images!
  2. #Everything is simple!
  3.  
  4. from PIL import Image
  5. import sys,os
  6.  
  7. if(len(sys.argv)>1):
  8. for i in range(1, len(sys.argv)):
  9. file=sys.argv[i]
  10. split_tup = os.path.splitext(file)
  11. file_name=split_tup[0]+".jpg"
  12. im=Image.open(file).convert("RGB")
  13. im.save(file_name,"jpeg")
  14. os.remove(file)
Advertisement
Add Comment
Please, Sign In to add comment