Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@robertvalik
Last active January 31, 2018 20:57
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 robertvalik/ee9bc87972e326311cef5f505d44cec3 to your computer and use it in GitHub Desktop.
Save robertvalik/ee9bc87972e326311cef5f505d44cec3 to your computer and use it in GitHub Desktop.
Darktable Basecurve helper script from https://www.youtube.com/watch?v=LufwQZx01gk
#!/bin/bash
#
# Darktable Basecurve helper script
# Rewritten from Harry Durgin's videos on Basecurves
# https://www.youtube.com/watch?v=LufwQZx01gk (a must-see!)
# This script has as little changes as possible.
#
# Don't forget to back up your ~/.config/darktable/data.db !!!
MODEL_TABLE=model_iso_db
COMBI_TABLE=iso_model_combinations
cat /dev/null > $MODEL_TABLE
FILE=`ls|grep -i jpg|head -n1|cut -d'.' -f1`
EXT=`ls "$FILE".* |grep -iv jpg |grep -iv xmp |head -n1|cut -d'.' -f2`
for RAWFILE in `ls *.$EXT`
do
ISO=`exiftool "$RAWFILE" |grep -i iso |head -n1 |awk -F': ' '{print $2}'`
MODEL=`exiftool "$RAWFILE" |grep -i model |head -n1 |awk -F': ' '{print $2}'`
echo $RAWFILE $ISO $MODEL >> $MODEL_TABLE
done
cat $MODEL_TABLE |cut -d' ' -f2- |sort |uniq > $COMBI_TABLE
IFS=$'\n'
for MODELISO in `cat $COMBI_TABLE`
do
rm -f basecurve.dat basecurve.fit.dat basecurve.sh dt-curve-tool.bin tonecurve.dat tonecurve.fit.dat
ISO=`echo $MODELISO |cut -d' ' -f1`
MODEL=`echo $MODELISO |cut -d' ' -f2-`
for RAWFILE in `grep $MODELISO $MODEL_TABLE |cut -d' ' -f1`
do
dt-curve-tool-helper "$RAWFILE"
LAST="$RAWFILE"
done
dt-curve-tool -z -e $LAST -n6 |sed -e "s/$MODEL/$MODEL\ ($ISO)/g" > basecurve.sh
sh ./basecurve.sh
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment