]> git.scottworley.com Git - picsort/blame - pics-preprocess
Resumability: Skip processing if output exists
[picsort] / pics-preprocess
CommitLineData
e18c13a6
SW
1#!/bin/bash
2
3# Pass .NEF files as $@.
4# This makes many variants of each one at different exposure levels.
5
6GREEN=1.105
7TEMPERATURE=5500
8JPEGCOMPRESSION=95
9952a1a7 9SMALLHEIGHT=700
e18c13a6
SW
10
11
12for f;do
13 for level in {10..30};do
9952a1a7 14 mkdir -p {,sm/}"$level"
e18c13a6
SW
15 base="$(basename "$f")"
16 out="$level/${base%.NEF}.jpeg"
17 exposure=$(dc <<< "2k $level 4 / 3.5-p") # 10 to 30 -> -1 to 4 in .25 steps
fd69f569
SW
18 if [[ ! -s "$out" ]];then
19 ufraw-batch --out-type=jpeg \
20 --green="$GREEN" \
21 --temperature="$TEMPERATURE" \
22 --compression="$JPEGCOMPRESSION" \
23 --exposure="$exposure" \
24 --output="$out" \
25 "$f"
26 fi
27 if [[ ! -s "sm/$out" ]];then
28 convert "$out" -geometry "x$SMALLHEIGHT" "sm/$out"
29 fi
e18c13a6
SW
30 done
31done