Skip to content

Instantly share code, notes, and snippets.

@dshr
dshr / fakefilm.sh
Created September 22, 2018 14:33
Applies a fake 35mm film effect to all JPGs in a folder
#!/bin/sh
for i in *.JPG; do
magick $i hald_clut_file.png -hald-clut -set colorspace RGB -separate -seed 1000 -attenuate 0.42 +noise gaussian -combine -sharpen 10 output/$i;
done;
@dshr
dshr / dedupe.sh
Last active March 7, 2018 12:42
Moves all CR2 files that have no JPGs with the same name to a separate directory
#!/bin/sh
mkdir -p duplicates && find . -name '*.CR2' -execdir sh -c '[ ! -f "${0%.CR2}.jpg" ]' {} \; -execdir mv {} duplicates/ \;
@dshr
dshr / raw_to_audio.sh
Created June 3, 2017 22:45
Play raw files as audio
#!/bin/sh
# play into core audio
cat file | sox -q -t raw -r 16000 -b 8 -e unsigned-integer - -t coreaudio vol 0.5
# save as wav
cat file | sox -q -t raw -r 16000 -b 8 -e unsigned-integer - output.wav