Skip to content

Instantly share code, notes, and snippets.

@iambibhas
Created October 23, 2012 20:20
Show Gist options
  • Save iambibhas/3941283 to your computer and use it in GitHub Desktop.
Save iambibhas/3941283 to your computer and use it in GitHub Desktop.
Batch resizing JPEG images with ImageMagick
#!/bin/bash
if [ ! -d ./resized ]; then mkdir ./resized; fi;
# creates the screen image
for f in *.JPG;
do
echo "Processing $f"
convert -strip -modulate 105,110,100 -resize "1024x768" -unsharp 0,1.5,0.05 \
$f ./resized/$f
done
cd ./resized
# change the image names
for i in *.JPG;
do
mv "$i" "${i/.JPG}"_s.JPG;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment