-
-
Save vivekvasani/48f476236d051dc1f7bb to your computer and use it in GitHub Desktop.
Imagemagick recursively reduce files to < 800x600 and 72ppi
This file contains 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
# This is a bash script meant to be run on the command line. Requires imagemagick (apt-get install imagemagick) | |
## THIS WILL OVERWRITE YOUR FILES, uses sudo and may not require it. | |
for file in /path/to/files/*/*.jpg; do sudo convert $file -resize '800x600>' -density 72 $file; done | |
### another method using resolution (800*600) | |
for file in /path/to/files/*/*.jpg; do sudo convert $file -resize '480000@>' -density 72 $file; done | |
### example of *not* overwriting files | |
for file in /path/to/files/*/*.jpg; do sudo convert $file -resize '800x600>' -density 72 converted-$file; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment