Skip to content

Commit

Permalink
Made glitches more random
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Roberts committed May 5, 2013
1 parent 74fd9f6 commit 49f5506
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 132 deletions.
6 changes: 3 additions & 3 deletions README
@@ -1,4 +1,4 @@
What Glitch? What Glitch? scripts
By Antonio Roberts By Antonio Roberts
www.hellocatfood.com www.hellocatfood.com
GNU/GPL. GNU/GPL.
Expand All @@ -18,11 +18,11 @@ Basic Usage
================== ==================
1. Make the file executable: In a terminal type chmod+x what_glitch_1bitgif.sh 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 2. Run ./what_glitch_1bitgif.sh /path/to/video/file
3. Hit enter 3. Hit Enter
4. Wait 4. Wait


Notes 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 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!
14 changes: 4 additions & 10 deletions what_glitch_1bitgif.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp avconv -i $file -b "$bitRate"k out_%d.bmp


Expand All @@ -41,5 +36,4 @@ avconv -i out_%d.gif -b "$bitRate"k "$file"_1bitgif.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_1bitgif.mkv"
33 changes: 18 additions & 15 deletions what_glitch_CMYK.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp avconv -i $file -b "$bitRate"k out_%d.bmp


Expand All @@ -26,19 +21,29 @@ no=1
while [ $no -le $fileno ] while [ $no -le $fileno ]
do 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 convert -colorspace CMYK -separate out_$no.bmp in_%d.bmp


#glitch the cyan channel #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 #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 #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 #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 #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 convert in_0.bmp in_1.bmp in_2.bmp in_3.bmp -set colorspace CMYK -combine out_$no.bmp
Expand All @@ -57,6 +62,4 @@ avconv -i out_%d.bmp -b "$bitRate"k "$file"_bmpcmyk.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_bmpcmyk.mkv"
echo -e "----------------------------------------------------"
20 changes: 8 additions & 12 deletions what_glitch_bmp.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp avconv -i $file -b "$bitRate"k out_%d.bmp


Expand All @@ -26,8 +21,11 @@ no=1
while [ $no -le $fileno ] while [ $no -le $fileno ]
do 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 #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" echo -e "Glitched file $no of $fileno"


Expand All @@ -40,6 +38,4 @@ avconv -i out_%d.bmp -b "$bitRate"k "$file"_bmp.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_bmp.mkv"
echo -e "----------------------------------------------------"
20 changes: 8 additions & 12 deletions what_glitch_jpg.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.jpg avconv -i $file -b "$bitRate"k out_%d.jpg


Expand All @@ -26,8 +21,11 @@ no=1
while [ $no -le $fileno ] while [ $no -le $fileno ]
do 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 #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" echo -e "Glitched file $no of $fileno"


Expand All @@ -40,6 +38,4 @@ avconv -i out_%d.jpg -b "$bitRate"k "$file"_jpg.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_jpg.mkv"
echo -e "----------------------------------------------------"
20 changes: 8 additions & 12 deletions what_glitch_pcx.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.pcx avconv -i $file -b "$bitRate"k out_%d.pcx


Expand All @@ -26,8 +21,11 @@ no=1
while [ $no -le $fileno ] while [ $no -le $fileno ]
do 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 #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" echo -e "Glitched file $no of $fileno"


Expand All @@ -40,6 +38,4 @@ avconv -i out_%d.pcx -b "$bitRate"k "$file"_pcx.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_pcx.mkv"
echo -e "----------------------------------------------------"
27 changes: 8 additions & 19 deletions what_glitch_pix.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.bmp avconv -i $file -b "$bitRate"k out_%d.bmp


Expand Down Expand Up @@ -42,16 +37,12 @@ no=1
while [ $no -le $fileno ] while [ $no -le $fileno ]
do 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 #glitch the files


sed -i s/a/b/g out_$no.pix sed -i s/$rand1/$rand2/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


echo -e "Glitched file $no of $fileno" echo -e "Glitched file $no of $fileno"


Expand Down Expand Up @@ -82,6 +73,4 @@ avconv -i out_%d.bmp -b "$bitRate"k "$file"_pix.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_pix.mkv"
echo -e "----------------------------------------------------"
15 changes: 4 additions & 11 deletions what_glitch_ppm.sh
@@ -1,20 +1,15 @@
#!/bin/bash #!/bin/bash


echo -e $0
echo -e "By Antonio Roberts | hellocatfood"
echo -e "www.hellocatfood.com"
echo -e "GNU/GPL. See Licence"
file=$1 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 #make a directory to do the glitching
rand=$RANDOM rand=$RANDOM
mkdir /tmp/temp_$rand mkdir /tmp/temp_$rand
cd /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 #convert the movie to frames
avconv -i $file -b "$bitRate"k out_%d.ppm avconv -i $file -b "$bitRate"k out_%d.ppm


Expand All @@ -40,6 +35,4 @@ avconv -i out_%d.ppm -b "$bitRate"k "$file"_ppm.mkv


#remove the temporary directory #remove the temporary directory
cd ../ cd ../
rm -rf temp_$rand/ rm -rf temp_$rand/
echo -e "Job done. Check for "$file"_ppm.mkv"
echo -e "----------------------------------------------------"

0 comments on commit 49f5506

Please sign in to comment.