We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Glitch art (how)
Page Index Toggle Pages: 1
Glitch art (how?) (Read 1996 times)
Glitch art (how?)
Dec 15th, 2009, 6:30am
 
Hi,

I want to explore the concept of "glitch art". A good starting point might be to produce results similar to Ted Davis' Text2Image algorithm.

So far I have been hacking a few things together at random, but I would really appreciate if any of you guys could give me a few pointers on how to approach the "glitch art" topic?

Thanks in advance Smiley
Re: Glitch art (how?)
Reply #1 - Dec 19th, 2009, 5:40pm
 
hi, i don't really feel comfortable with it yet myself, but i'd say take a look at loadPixels(), updatePixels() and the pixels[] array, as well as bitwise operations (bit-shifting).

Re: Glitch art (how?)
Reply #2 - Dec 20th, 2009, 4:35am
 
yeah. i once had a program that was intended to copy files. it totally glitched my images. i wasn't happy about that and fixed it. now trying to do something similar i just destroy the images Smiley
Re: Glitch art (how?)
Reply #3 - Dec 20th, 2009, 5:16am
 
heh yeah, couple of weeks ago i was trying to send images over wifi between two computers and used the OSC protocol for this, i.e. i sent the image pixel by pixel and stitched it back together at the other side... it was fast, but some amount of pixels just got lost in the air. Unintended, glitchy effect.
i guess glitch art has to be hacky...
anyway, i've been doing
this using pixel array and some experimenting with simple +- operations...
Re: Glitch art (how?)
Reply #4 - Dec 20th, 2009, 7:07am
 
phling wrote on Dec 20th, 2009, 5:16am:
anyway, i've been doing
this using pixel array and some experimenting with simple +- operations...


Amazing stuff! how did you get there
Re: Glitch art (how?)
Reply #5 - Dec 20th, 2009, 8:20am
 
thanks  Smiley

it's a prototype for a glitched-out 2D shooter:
http://dl.dropbox.com/u/1358257/shooter/3d_prototype/applet/index.html
(browser needs to be in 32bit mode, and you have to trust it as it will load enemy sprites from flickr. there's not much gameplay in there.. but you can control avatar 1 with cursor keys, shoot with alt).

for the glitches:
Code:
void pixelShifter()
{
loadPixels();
sincounter1 +=0.01;
sincounter2 +=0.005;
int bla = (int)(sin(sincounter1)*1000);
int bla2 = (int)(sin(sincounter1)*6);

counter = counter +counter;
if(counter > pixels.length) counter = 1;

for(int i = 0; i < pixels.length; i++){
if(i < pixels.length-bla2-width*2)
{
pixels[i] = pixels[i] | lastPixels[i+bla2+width*2]+bla;
}
lastPixels[i] =  pixels[i];
}
updatePixels();
}


there's basically the pixel array which is there from beginning, and an array i called lastPixels as a temporary buffer. Each frame these arrays are mixed into each other, not directly on top but offset in a certain direction, determined by "bla2".
Code:
pixels[i] = pixels[i] | lastPixels[i+bla2+width*2]+bla; 


also there is some arbitrary number added to each pixel ("bla") and i don't know what exactly it does, but it totally messes up color  Grin . bla and bla2 are controlled by sine waves, so the glitches are slowly changing direction...

it's fun to experiment with values in there but i have to say... i've seen the OS X curtain of Death quite a lot when running a sketch, probably doing something the gfx card does not want me to do.

the difficult thing imo is to gain actual control over glitches, i.e. changing intensity or location on screen...
Page Index Toggle Pages: 1