darktable-cli translated from rawtherapee-cli

darktable

(Colin Pittendrigh) #1

The following is one line from a linux focus stacking script

After shooting a stack of Nikon *.NEF raws I use rawtherapee to edit only one raw from the stack. Save now.pp3 in the local directory and then invoke the following to create a corresponding stack of *.tifs (in a ./tifs directory), all edited as per the first one.

rawtherapee-cli -o tifs -p ./now.pp3 -b16 -t -Y -c .

What syntax would I use to do the same thing with darktable? (with now.pp3 as now.xmp)

Ah. Perhaps I need to wrap this in a loop:

#!/bin/bash
for file in *.NEF
do
darktable-cli $file now.xmp tifs/$file.tif
done


(Colin Pittendrigh) #2

OK that does seem to work. Here’s the rest of the script fwiw
If I named this script as ~/bin/stackit I would invoke it with:
stackit caputure_01234.NEF

#!/bin/bash

here=pwd ## pwd surrounded by back ticks
mkdir tifs
crop=0

first=$1

if [[ -n $2 ]]
then
crop=$2
fi

darktable $first;

##/usr/local/bin/rawtherapee -cli -o tifs -p ./now.pp3 -b16 -t -Y -c .
for file in *nef
do
darktable-cli $file $first.xmp tifs/$file.tif
done

on big magnification with bellows and/or tubes I

often get a random black border around the images.

that semi-random border confuses the stacking software.

Cropping a few pixels off the edges fixes that.

if [[ “$crop” -gt 0 ]]
then
for file in tifs/*tif
do
convert $file -shave “$cropx$crop” delme.tif 2>/dev/null
cp delme.tif $file
done
fi

cd tifs
~/bin/ZereneStacker/ZereneStacker.bsh *tif
. cd $here/tifs

//////////I end up using ZereneStacker which is not open source. But it’s cheap and good and written by one guy.

With Zerene I make a single tif from the stack, and then send that off go Gimp for final retouching.