Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "this will delete all tif files in subfolders"
- echo "press enter to continue, or type 'upscale' and then press enter to continue with upscaling"
- echo "upscaling did not yield any improvement in image quality for me tho"
- echo "you may need to edit /etc/ImageMagick-6/policy.xml for this to work, particularly memory and disk entry"
- echo "6 might be another number on your machine"
- read upscale
- #iterate over folders
- for dir in ./*/
- do
- cd $dir
- echo $dir
- #align images, the "2>/dev/null" part discards warnings
- #call it twice since shell is case sensitive
- #assumes all images have same ending case
- align_image_stack -a OUT *.jpg 2>/dev/null
- align_image_stack -a OUT *.JPG 2>/dev/null
- #upscale images
- if [ $upscale = "upscale" ]
- then
- echo "upscaling..."
- mogrify -resize 200% *.tif
- echo "done upscaling..."
- else
- echo "skipping upscaling..."
- fi
- #find median, write to base folder
- echo "finding median..."
- convert *.tif -evaluate-sequence median ../${dir%*/}.jpg
- #delete temporary files
- rm *.tif
- cd ..
- echo "done!"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement