BatchRAW
BatchRAW / Guides

How to Convert RAW to JPG From the Command Line

Published

If you process the same kind of shoot every week, a script beats clicking through an app. These are the most useful command-line tools for RAW-to-JPG, grouped by what they actually do: extract the camera's embedded JPEG (fast) or develop the raw data (slow, full control).

Extract the embedded JPEG (seconds per folder)

ExifTool (any OS)

exiftool -b -JpgFromRaw -w %d%f.jpg -ext NEF -r .

Full details, tag names per brand and how to copy metadata across: ExifTool preview extraction.

dcraw / LibRaw

dcraw -e *.CR2

Writes IMG_0001.thumb.jpg next to each file. The original dcraw is no longer maintained and may not recognize newer cameras; ExifTool always works as a fallback.

Develop the raw data

macOS: sips

mkdir jpg
sips -s format jpeg -s formatOptions 90 -Z 2560 *.ARW --out jpg/

-Z 2560 caps the long edge. Uses Apple's RAW engine.

ImageMagick (Windows, macOS, Linux)

# macOS / Linux
mkdir -p jpg && magick mogrify -format jpg -quality 90 -path jpg *.CR3

# Windows PowerShell
mkdir jpg; Get-ChildItem *.CR3 | ForEach-Object { magick $_.FullName -quality 90 "jpg\$($_.BaseName).jpg" }

ImageMagick hands RAW decoding to LibRaw. Rendering is neutral and fairly slow.

darktable-cli

for f in *.NEF; do darktable-cli "$f" "jpg/${f%.*}.jpg" --width 2560 --height 2560; done

Add an .xmp file as the second argument to apply a saved edit to every image.

rawtherapee-cli

mkdir -p jpg && rawtherapee-cli -o jpg/ -j90 -p look.pp3 -c *.RAF

Which should you use?

GoalTool
JPGs that match the camera, fastExifTool, dcraw -e
Simple conversion on a Macsips
Cross-platform scriptingImageMagick
Apply an edit to hundreds of filesdarktable-cli or rawtherapee-cli

Parallelize

All of these process one file at a time. On macOS/Linux, GNU parallel or xargs -P uses every core:

ls *.NEF | xargs -P 8 -I{} sh -c 'darktable-cli "{}" "jpg/$(basename "{}" .NEF).jpg"'

No terminal? Same result in a browser

BatchRAW is the extraction approach with a drag-and-drop interface: parallel workers, resizing, quality settings and a ZIP at the end, all local.

Convert RAW files to JPG in your browser. BatchRAW is free, needs no install or account, and your files never leave your device. Drop a whole folder and get a ZIP of JPGs back.

Open BatchRAW →