Skip to content

Instantly share code, notes, and snippets.

@aschmelyun
Created December 5, 2020 00:55
Show Gist options
  • Save aschmelyun/86a51ab85a7b6eeb9c6f8a5e405286bb to your computer and use it in GitHub Desktop.
Save aschmelyun/86a51ab85a7b6eeb9c6f8a5e405286bb to your computer and use it in GitHub Desktop.
Bash script to convert CR2 images to JPG using dcraw
#!/usr/bin/bash
# usage ./cr2_to_jpg.sh /path/to/cr2/images/ /path/to/converted/jpgs/
i=1
total=$(find $1 -type f | wc -l)
for file in $1*.CR2
do
dcraw -c -w -b 1.5 $file | pnmtojpeg > $2$(basename $file .CR2).jpg
ls -l | echo "$(basename $file) - $i/$total"
i=$((i + 1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment