Skip to content

Instantly share code, notes, and snippets.

@hashd
Last active October 9, 2017 21:33
Show Gist options
  • Save hashd/a9875a68b9f839bd24b809fee75da243 to your computer and use it in GitHub Desktop.
Save hashd/a9875a68b9f839bd24b809fee75da243 to your computer and use it in GitHub Desktop.
Batch convert NEF to jpg in Linux/macOS [Prerequisites: ImageMagick, ufraw-batch]
#!/bin/bash
# Change to directory at first argument or use the current folder
if [ ! -z "$1" ]; then
cd "$1"
fi
mkdir -p jpeg
for file in *.NEF; do
filename="${file%.NEF}.jpg"
echo "Converting $file to $filename"
# Add these flags to convert and attempt auto enhancement
# --channel rgb -auto-level -enhance -equalize -contrast
convert $file $filename
mv $filename jpeg/ 2>/dev/null
rm $file
done
@praveenpuglia
Copy link

What does jpeg/ 2>/dev/null mean?

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