Skip to content

Instantly share code, notes, and snippets.

@sepastian
Created June 18, 2023 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
# 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' \
| 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