Last active
January 31, 2018 20:57
-
-
Save robertvalik/ee9bc87972e326311cef5f505d44cec3 to your computer and use it in GitHub Desktop.
Darktable Basecurve helper script from https://www.youtube.com/watch?v=LufwQZx01gk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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