Created
October 1, 2015 10:07
-
-
Save biiont/be88ebb6f1b04b0f91e9 to your computer and use it in GitHub Desktop.
Batch image resample
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/sh | |
# This script allows to resample images from whatever DPI to 75 DPI (screen resolution) | |
# in batch. I use it to prepare smallsize images of scans of my IDs, etc... | |
cd path/to/collections/base/dir | |
for fi in $(/bin/ls -1 image_collection_600dpi/*) | |
do | |
fo="$(echo $fi | sed 's/_[[:digit:]]\+dpi//g')" | |
echo convert-im6 $fi -units PixelsPerInch -resample 75 $fo | |
done | |
# Oneline | |
cd ~/org/id | |
for fi in $(/bin/ls -1 passeport_600dpi/*); do fo="$(echo $fi | sed 's/_[[:digit:]]\+dpi//g')"; echo convert-im6 $fi -units PixelsPerInch -resample 75 $fo; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment