Skip to content

Instantly share code, notes, and snippets.

@bordeo
Created May 8, 2018 08:30
Show Gist options
  • Save bordeo/5ec53fae272c0888291f10df7b909f0a to your computer and use it in GitHub Desktop.
Save bordeo/5ec53fae272c0888291f10df7b909f0a to your computer and use it in GitHub Desktop.
#!/bin/bash
FOLDER_TO_CONVERT=$1
FOLDER_TO_SAVE=$2
for filename in $FOLDER_TO_CONVERT/*.jpg; do
basename="$(basename "$filename" .jpg)"
convert "$FOLDER_TO_CONVERT/$basename.jpg" -sampling-factor 4:2:0 -strip -quality 80 -interlace JPEG -colorspace sRGB "$FOLDER_TO_SAVE/$basename.jpg"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment