This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#For use with a set of sequential files that contain extra zeroes. ex: file001.jpg, file002.jpg, file003.jpg ect. | |
#Replace <firstPartOfName> with everything up until the bit you want to remove. No brackets. | |
#replace <removeThis> with what you need removed, <replaceWithThis> for what you want in its place. | |
#You can leave <replaceWithThis> blank if you simply want to remove. | |
for file in <firstPartOfName>*; do | |
new_name=$(echo "$file" | sed -E -e 's/<removeThis>+/<replaceWithThis>/') | |
mv "$file" "$new_name" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get the number of frames from the gif: | |
identify -format "%n\n" path/to/file.gif | head -1 | |
#Use gifsicle to cut frames. replace 99 with total frames. | |
gifsicle -U input.gif `seq -f "#%g" 0 2 99` -O2 -o output.gif | |
#Delay gif via gifsicle by first finding the delay between frames, double it | |
gifsicle -I input.gif | |
#Proceed to delay. Replace 50 with the doubled number | |
gifsicle --delay 50 in.gif > out.gif |