Scripts

My Scripts

Composite with Watermark Module

ls -t .config/darktable/watermarks/tmp* |grep -v svg |head -n1 |read file
inkscape -f "$file" -l '.config/darktable/watermarks/tmp.svg'
ls -l '.config/darktable/watermarks/tmp.svg' |cut -d' ' -f5 |read size_n
ls -lh '.config/darktable/watermarks/tmp.svg' |cut -d' ' -f5 |read size_h
[ $size_n -gt 8000000 ] && echo "File too large. Size $size_h, but needs to be smaller than 8M." || echo "File size okay $size_h"

Monitor Calibration

#!/bin/zsh

dispwin -c
dispcal -v -m -H -y l -q l -t 6500 -b 80 -g 2.2 web
targen -v -d 3 -G -f 128 web
dispread -v -N -H -y l -k web.cal web
colprof -v -D "web" -C "Harry Durgin Photography" -q m -a G -n c web

dispwin -c
dispcal -v -m -H -y l -q l -t 5500 -b 80 -g 2.2 print
targen -v -d 3 -G -f 128 print
dispread -v -N -H -y l -k print.cal print
colprof -v -D "print" -C "Harry Durgin Photography" -q m -a G -n c print

Focus Stack

#!/bin/zsh

rm a_*
ls *.tif |head -n1 |cut -d'.' -f1 |read first
align_image_stack -m -g11 -f 100 -a a_ *.tif
enfuse-mp -o $first'_fused.tif' --exposure-weight=0 --saturation-weight=0 --contrast-weight=1 --hard-mask a_*.tif
convert a_*.tif -average $first'_avg.tif'
convert `ls a_*.tif` -evaluate-sequence mean -quality 100% $first'_mean.tif'

HDR Stack

#!/bin/zsh

rm a_*
mkdir results &> /dev/null
ls *.tif |head -n1 |cut -d'.' -f1 |read file

echo -n 'focal length (24mm): '; read focal_length; focal_length=`echo $focal_length |cut -d'm' -f1`

if [[ -z $focal_length ]]; then
  lens=24
else
  if [ $width -gt $height ]; then
    echo "a(36/($focal_length*2))/3.14*360" |bc -l |cut -d'.' -f1 |read lens
  else
    echo "a(24/($focal_length*2))/3.14*360" |bc -l |cut -d'.' -f1 |read lens
  fi
fi

align_image_stack -g9 -m -f $lens -a a_ *.tif &>/dev/null
enfuse-mp -o results/focus.tif --exposure-weight=0 --contrast-weight=1 --saturation-weight=0 a_*.tif &> /dev/null
enfuse-mp -o results/hdr.tif --exposure-weight=1 --entropy-weight=0 --saturation-weight=0 a_*.tif &> /dev/null
enfuse-mp -o results/luma.tif --exposure-weight=0 --entropy-weight=0 --saturation-weight=1 a_*.tif &> /dev/null
convert `ls a_*.tif` -evaluate-sequence mean -quality 100% results/mean.tif
rm a_*.tif
cd results
convert 
  focus.tif 
  focus.tif 
  hdr.tif 
  hdr.tif 
  luma.tif 
  mean.tif 
  -average $file'_result_mean.tif'
convert 
  focus.tif 
  focus.tif 
  hdr.tif 
  hdr.tif 
  luma.tif 
  -average $file'_result.tif'