#!/bin/bash # avpkstacking.bash AV+PKstacking of jpg files in this folder FILE_LIST=$( ls -tr *jpg | tail -99 | sed ':a;N;$!ba;s/\n/ /g' ) # ls lists files in directory sorted jpg and reversed in time (-tr) # tail -99 is only the last 99 files # sed ... removes the newlines between file names, all is on one single line # Print some data to the output screen echo $FILE_LIST echo "WAIT" # ImageMagic average stack convert $FILE_LIST -average aaa-av.png echo "average stack aaa-av.png ready" echo "WAIT" # ImageMagic peak stack convert $FILE_LIST -background black -compose lighten -flatten aaa-pk.png echo "peak stack aaa-pk.png ready" echo "READY" sleep 10 # If you want the terminal screen 10 seconds open when finished exit 0 ####################### # EXPLANATION # ####################### # Copy this bash file "avpkstacking.bash" to the folder with the jpg.files # THE FOLDER SHALL ONLY CONTAIN THE JPG FILES YOU WANT TO USE FOR THE STACKING # All jpg files till a maximum of 99 will be stacked to an average and peak picture # If you want to use less recent jpg files, change the -99 to the value you want # For example: -24 for an 8 hour time period and 20 minute grabs # The results will be in aaa-av.png and aaa-pk.png # As it are png files, they are not part of the stacking file list # IMPORTANT! SET THE PROPERTIES OF THIS BASH FILE TO: Permissions --> Execute --> Anyone! #######################