#!/bin/bash ################################ # Written by Jeremy Green # http://www.rhythmandcode.com/ ################################ LONGDIR=$(pwd) DIR=${LONGDIR##*/} SMALLSIZE=1024 MODE=full #MODE should be 'full' or 'thumb' OUTPUTDIR=. if [ $# = 1 ]; then echo "custom mode: $1" MODE=$1 fi if [ $# = 2 ]; then echo "custom num: $2" DIR=$2 fi brightnesses=( -8 ) chromatic_adaptations=( 0.92 ) light_adaptations=( 0.95 ) echo "running pfstone mapping operation" #This one scales the images within 1024x1024 I=1; #img # (useful for panos) for b in "${brightnesses[@]}" do for c in "${chromatic_adaptations[@]}" do for l in "${light_adaptations[@]}" do if [ -f $OUTPUTDIR/$DIR.$MODE.auto_reinhard05_b.$b-c.$c-l.$l--$I.jpg ]; then echo " image exists remove to regenerate $OUTPUTDIR/$DIR.$MODE.auto_reinhard05_b.$b-c.$c-l.$l--$I.jpg" else echo "generating image" pfsin $DIR.$MODE.exr | pfstmo_reinhard05 -c $c -b $b -l $l | pfsout $OUTPUTDIR/$DIR.$MODE.auto_reinhard05_b.$b-c.$c-l.$l--$I.jpg fi if [ -f $OUTPUTDIR/$DIR.aligned.$MODE.auto_reinhard05_b.$b-c.$c-l.$l--$I.jpg ]; then echo " image exists remove to regenerate $OUTPUTDIR/$DIR.aligned.$MODE.auto_reinhard05_b.$b-c.$c-l.$l--$I.jpg" else echo "generating image" pfsin $DIR.aligned.$MODE.exr | pfstmo_reinhard05 -c $c -b $b -l $l | pfsout $OUTPUTDIR/$DIR.aligned.$MODE.auto_reinhard05_b.$b-c.$c-l.$l--$I.jpg fi fi ((I++)); done done done