Skip to content

Instantly share code, notes, and snippets.

@aurelienpierre
Created January 19, 2014 08:42
Show Gist options
  • Save aurelienpierre/8502089 to your computer and use it in GitHub Desktop.
Save aurelienpierre/8502089 to your computer and use it in GitHub Desktop.
A simple script which applies non-destructive optimization algorithms on png and jpg files in order to adjust size vs quality. It proceeds every file in a directory. Linux only. It can easily be added in Nautilus through Nautilus-Actions.
#!/bin/bash
# Required commands :
# - optipng
# - jpegoptim
# optipng (non destructive)
optipng *.png
optipng *.PNG
# optimize JPG (non-destructive)
jpegoptim *.jpg
jpegoptim *.JPG
jpegoptim *.jpeg
jpegoptim *.JPEG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment