Skip to content

Instantly share code, notes, and snippets.

@sepastian
Last active April 3, 2025 13:25
Show Gist options
  • Save sepastian/4cd07f3220f2e7adae77ac6409fd4e35 to your computer and use it in GitHub Desktop.
Save sepastian/4cd07f3220f2e7adae77ac6409fd4e35 to your computer and use it in GitHub Desktop.
RAW to PPM (dcraw) to JPG (imagemagick)
#!/bin/bash
set -euo pipefail
# Find files created within 1 days (`-ctime -1`);
# convert (Nikon/NEF) RAW images to PPM using dcraw;
# write results to stdout with -c;
# convert stdin to JPG using Imagemagick's convert;
# specify format of input image with 'ppm:-'.
find /path/to/sdcard/ -name '*.NEF' -ctime -1 \
| parallel 'dcraw -c {} \
| convert -verbose ppm:- {/.}.jpg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment