Permalink
Browse files

Made glitches more random

  • Loading branch information...
1 parent 74fd9f6 commit 49f5506222daa23cb14ef40c84fdfe72f8742bee @hellocatfood committed May 5, 2013
Showing with 92 additions and 132 deletions.
  1. +3 −3 README
  2. +4 −10 what_glitch_1bitgif.sh
  3. +18 −15 what_glitch_CMYK.sh
  4. +8 −12 what_glitch_bmp.sh
  5. +8 −12 what_glitch_jpg.sh
  6. +8 −12 what_glitch_pcx.sh
  7. +8 −19 what_glitch_pix.sh
  8. +4 −11 what_glitch_ppm.sh
  9. +15 −14 what_glitch_rgb.sh
  10. +8 −12 what_glitch_sgi.sh
  11. +8 −12 what_glitch_tga.sh
View
6 README
@@ -1,4 +1,4 @@
-What Glitch?
+What Glitch? scripts
By Antonio Roberts
www.hellocatfood.com
GNU/GPL.
@@ -18,11 +18,11 @@ Basic Usage
==================
1. Make the file executable: In a terminal type chmod+x what_glitch_1bitgif.sh
2. Run ./what_glitch_1bitgif.sh /path/to/video/file
-3. Hit enter
+3. Hit Enter
4. Wait
Notes
==================
The scripts have only been tested on Ubuntu 10.10 and 12.04. If you are able to get them working with other operating systems please feel free to share your techniques
-As this scripts processes each frame of a video file it will take a very long time to complete. It is recommended for use only on small video clips!
+As this scripts processes each frame of a video file it will take a very long time to complete. It is recommended for use only on short video clips!
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp
@@ -41,5 +36,4 @@ avconv -i out_%d.gif -b "$bitRate"k "$file"_1bitgif.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_1bitgif.mkv"
+rm -rf temp_$rand/
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp
@@ -26,19 +21,29 @@ no=1
while [ $no -le $fileno ]
do
+rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+rand3=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+rand4=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+
+rand5=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2)
+rand6=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2)
+rand7=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2)
+rand8=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2)
+
convert -colorspace CMYK -separate out_$no.bmp in_%d.bmp
#glitch the cyan channel
-sed -i s/t/63a/g in_0.bmp
+sed -i s/$rand1/$rand5/g in_0.bmp
#glitch the magenta channel
-sed -i s/l/££uns/g in_1.bmp
+sed -i s/$rand2/$rand6/g in_1.bmp
#glitch the yellow channel
-sed -i s/h/£24/g in_2.bmp
+sed -i s/$rand3/$rand7/g in_2.bmp
#glitch the key channel
-sed -i s/a/64a/g in_3.bmp
+sed -i s/$rand4/$rand8/g in_3.bmp
#combine the channels into one image
convert in_0.bmp in_1.bmp in_2.bmp in_3.bmp -set colorspace CMYK -combine out_$no.bmp
@@ -57,6 +62,4 @@ avconv -i out_%d.bmp -b "$bitRate"k "$file"_bmpcmyk.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_bmpcmyk.mkv"
-echo -e "----------------------------------------------------"
+rm -rf temp_$rand/
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp
@@ -26,8 +21,11 @@ no=1
while [ $no -le $fileno ]
do
+rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 3)
+
#glitch the files
-sed -i s/a/633/g out_$no.bmp
+sed -i s/$rand1/$rand2/g out_$no.bmp
echo -e "Glitched file $no of $fileno"
@@ -40,6 +38,4 @@ avconv -i out_%d.bmp -b "$bitRate"k "$file"_bmp.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_bmp.mkv"
-echo -e "----------------------------------------------------"
+rm -rf temp_$rand/
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.jpg
@@ -26,8 +21,11 @@ no=1
while [ $no -le $fileno ]
do
+rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 3)
+
#glitch the files
-sed -i s/@/63/g out_$no.jpg
+sed -i s/$rand1/$rand2/g out_$no.jpg
echo -e "Glitched file $no of $fileno"
@@ -40,6 +38,4 @@ avconv -i out_%d.jpg -b "$bitRate"k "$file"_jpg.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_jpg.mkv"
-echo -e "----------------------------------------------------"
+rm -rf temp_$rand/
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.pcx
@@ -26,8 +21,11 @@ no=1
while [ $no -le $fileno ]
do
+rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 3)
+
#glitch the files
-sed -i s/#/6a/g out_$no.pcx
+sed -i s/$rand1/$rand2/g out_$no.pcx
echo -e "Glitched file $no of $fileno"
@@ -40,6 +38,4 @@ avconv -i out_%d.pcx -b "$bitRate"k "$file"_pcx.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_pcx.mkv"
-echo -e "----------------------------------------------------"
+rm -rf temp_$rand/
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp
@@ -42,16 +37,12 @@ no=1
while [ $no -le $fileno ]
do
+rand1=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 2)
+rand2=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 1)
+
#glitch the files
-sed -i s/a/b/g out_$no.pix
-sed -i s/A/h/g out_$no.pix
-sed -i s/K/0/g out_$no.pix
-sed -i s/¿/e/g out_$no.pix
-sed -i s/@/$/g out_$no.pix
-sed -i s/t/b/g out_$no.pix
-sed -i s/#/g/g out_$no.pix
-sed -i s/h/o/g out_$no.pix
+sed -i s/$rand1/$rand2/g out_$no.pix
echo -e "Glitched file $no of $fileno"
@@ -82,6 +73,4 @@ avconv -i out_%d.bmp -b "$bitRate"k "$file"_pix.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_pix.mkv"
-echo -e "----------------------------------------------------"
+rm -rf temp_$rand/
View
@@ -1,20 +1,15 @@
#!/bin/bash
-echo -e $0
-echo -e "By Antonio Roberts | hellocatfood"
-echo -e "www.hellocatfood.com"
-echo -e "GNU/GPL. See Licence"
file=$1
-echo -e "Lets glitch $file"
-
-#get bitrate
-bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
#make a directory to do the glitching
rand=$RANDOM
mkdir /tmp/temp_$rand
cd /tmp/temp_$rand
+#get bitrate
+bitRate=$(avprobe $1 2>&1 | grep bitrate | cut -d ':' -f 6 | sed s/"kb\/s"//)
+
#convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.ppm
@@ -40,6 +35,4 @@ avconv -i out_%d.ppm -b "$bitRate"k "$file"_ppm.mkv
#remove the temporary directory
cd ../
-rm -rf temp_$rand/
-echo -e "Job done. Check for "$file"_ppm.mkv"
-echo -e "----------------------------------------------------"
+rm -rf temp_$rand/
Oops, something went wrong.

0 comments on commit 49f5506

Please sign in to comment.