Created
June 6, 2015 13:10
-
-
Save keiya/4dc1c1359e23bb53576d to your computer and use it in GitHub Desktop.
compress large uncompressed or lossless format into compressed/lossy format. // powered by imagemagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| CONV='/usr/bin/convert.exe' | |
| #find "$1" -type f \( -iname "*.bmp" \) -print0 | while IFS= read -r -d '' fullfile; do # BMP->PNG (Lossless) | |
| find "$1" -type f \( -iname "*.bmp" -o -iname "*.png" \) -print0 | while IFS= read -r -d '' fullfile; do # any Lossless to Lossy JPEG | |
| #$CONV "${fullfile}" "${fullfile}.png" && rm -f "${fullfile}" # BMP->PNG (Lossless) | |
| $CONV -quality 80 "${fullfile}" "${fullfile}.jpg" && rm -f "${fullfile}" # any Lossless to Lossy JPEG | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment