Skip to content

Instantly share code, notes, and snippets.

@munen
Created May 1, 2011 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save munen/950801 to your computer and use it in GitHub Desktop.
Save munen/950801 to your computer and use it in GitHub Desktop.
Script for compressing images. Saves me about 25-30% of space with no visible difference. Measured on pictures from my 10MP camera.
#!/bin/bash
# Script for compressing images. Saves me about 17% of space with no visible
# difference. Measured on > 250 pictures from my 10MP camera.
for image in "$@"
do
# Make exif tag in jpg - set's the file's creation date.
jhead -mkexif $image
convert -resize 80% -quality 85 $image $image
# Convert touched the file, tainting the creation date. Set it from the exif
# tag.
jhead -ft $image
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment