Skip to content

Instantly share code, notes, and snippets.

@dogmatic69
Created August 28, 2012 14:56
Show Gist options
  • Save dogmatic69/3498758 to your computer and use it in GitHub Desktop.
Save dogmatic69/3498758 to your computer and use it in GitHub Desktop.
convert nikon NEF files to png
#!/bin/bash
##################################
# Convert files to png #
# #
# #
##################################
files=`ls ./`;
if [ ! -d png ]
then
mkdir png;
fi
for file in $files
do
in=./$file;
out=./${file%.*}".png";
if [ ! -f $out ]
then
echo "converting $file";
convert "$in" -resize 1024x1024 "$out" ;
mv $out png/;
fi
done
@dogmatic69
Copy link
Author

Simple script for generating previews using imagemagic.

the -resize option of 1024x1024 will generate a image with max width or height (which ever is larger) of 1024. There are loads of other options

http://www.imagemagick.org/script/command-line-options.php#resize

http://www.imagemagick.org/script/command-line-processing.php#geometry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment