Skip to content

Instantly share code, notes, and snippets.

@uhthomas
Created April 15, 2025 17:49
Show Gist options
  • Save uhthomas/767a390e7d073f1481d4ac3a536a15ac to your computer and use it in GitHub Desktop.
Save uhthomas/767a390e7d073f1481d4ac3a536a15ac to your computer and use it in GitHub Desktop.
convert raw arw nef to jxl
#!/usr/bin/env bash
set -euo pipefail
while IFS= read -r -d '' file; do
echo "Processing: $file"
magick mogrify -format jxl "$file"
out="${file%.*}.jxl"
if [[ "${file,,}" == *".nef" ]]; then
cjxl --container=1 -d 0 "$out" "$out"
fi
/usr/bin/vendor_perl/exiftool -overwrite_original_in_place -tagsfromfile "$file" "$out"
echo "Successfully converted. Removing original..."
rm -f "$file"
done < <(find . -type f \( -iname "*.ARW" -o -iname "*.NEF" \) -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment