Skip to content

Instantly share code, notes, and snippets.

@k0001
Created August 27, 2008 19:46
Show Gist options
  • Save k0001/7566 to your computer and use it in GitHub Desktop.
Save k0001/7566 to your computer and use it in GitHub Desktop.
import glob, os
from subprocess import Popen
for name in (x[:-4] for x in glob.glob('./*.jpg')):
print '%s.jpg -> %s.png' % (name, name)
cmd = 'convert -quality 85 -type optimize %s.jpg %s.png' % (name, name)
Popen(cmd.split()).wait()
os.unlink('%s.jpg' % name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment