Basecurves

Let’s build our own basecurves

In this episode I work through each of the steps needed to build a custom basecurve. I also share some code I use to build a separate base curve for each camera body and ISO I use. In the end I show how to set up Darktable to automatically apply the appropriate basecurve to your RAW files.

Another in our faster format, but packed with information. It builds on knowledge from previous videos, running full-tilt through tools and methods to achieve the edit. For fuller explanations, return to the Home Page and scroll down to Topics Discussed or Modules Used on the right-hand bar. Click on any of these, and we assemble a complete playlist of every instance from a knowledge base of our first 27 videos for quick review right here on the site.

Build dt-curve-tool

cd
cp .config/darktable/data.db .config/darktable/data.db.bak
git clone git://github.com/darktable-org/darktable.git
cd darktable/tools/basecurve
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=$YOUR_INSTALL_PATH -DCMAKE_BUILD_TYPE=Release ..
sudo cmake --build . -- install

sample.jpg for creating basecurve

My script to build basecurves (make sure Darktable isn’t running when you run this)

#!/bin/zsh
rm iso_model_* basecurve.dat basecurve.fit.dat basecurve.sh dt-curve-tool.bin tonecurve.dat tonecurve.fit.dat
ls |grep -i jpg |head -n1 |cut -d'.' -f1 |read file
ls "$file".* |grep -iv jpg |grep -iv xmp |head -n1 |cut -d'.' -f2 |read ext
ls *.$ext |while read file; do
  exiftool "$file" |grep -i iso |head -n1 |awk -F': ' '{print $2}' |read iso
  exiftool "$file" |grep -i model |head -n1 |awk -F': ' '{print $2}' |read model
  echo $file $iso $model >>iso_model_db
done
cat iso_model_db |cut -d' ' -f2- |sort |uniq >iso_model_combinations
cat iso_model_combinations |while read combo; do
  echo $combo |cut -d' ' -f1 |read iso
  echo $combo |cut -d' ' -f2- |read model
  grep " $combo" iso_model_db |cut -d' ' -f1 |while read file; do
    dt-curve-tool-helper "$file"
    last="$file"
  done
  dt-curve-tool -z -e $last -n6 |sed -e "s/$model/$model ($iso)/g" >basecurve.sh
  sh ./basecurve.sh
  rm basecurve.dat basecurve.fit.dat basecurve.sh dt-curve-tool.bin tonecurve.dat tonecurve.fit.dat
done

One thought on “Basecurves

  1. Pingback: Weekly Edit 32: Basecurves – darktable FR

Leave a Reply

Your email address will not be published.