Difference between revisions of "User:Tom"
Line 2: | Line 2: | ||
I ran into a couple of gifs that visualised how certain sorting algorithms worked. Normally I don’t understand algorithms, but these visualisations made it so easy and insightful to understand what is going on. Besides that I think it’s cool to see an algorithm at work like this, I also think it has some artistic value. You could call it glitch art (glitch art:——————) | I ran into a couple of gifs that visualised how certain sorting algorithms worked. Normally I don’t understand algorithms, but these visualisations made it so easy and insightful to understand what is going on. Besides that I think it’s cool to see an algorithm at work like this, I also think it has some artistic value. You could call it glitch art (glitch art:——————) | ||
+ | |||
+ | These are some examples of different codes working on a color palette: | ||
+ | |||
+ | [[File:https://i.imgur.com/rWFaMvP.gifv]] | ||
It is a code creating a new kind of image by rearranging the original. This results in an image made anonymous. Or maybe more like a vague memory, where everything is still there but over time you start to forget what it looks like. This creates a new memory, a distorted version of the original. | It is a code creating a new kind of image by rearranging the original. This results in an image made anonymous. Or maybe more like a vague memory, where everything is still there but over time you start to forget what it looks like. This creates a new memory, a distorted version of the original. | ||
− | What is Pixel Sorting? | + | == What is Pixel Sorting? == |
Pixel Sorting is done with a program called Processing. It takes the pixels in a digital image and places them into a semblance of order. | Pixel Sorting is done with a program called Processing. It takes the pixels in a digital image and places them into a semblance of order. | ||
Line 12: | Line 16: | ||
Examples from artists/reddit | Examples from artists/reddit | ||
− | Experiment | + | == Experiment == |
− | |||
− | |||
− | This is a modified version of the code written bij Kim Asendorf. It is written in Processing language, and requires a folder called ‘data’ in the same location as the .pde processing file. | + | This is a modified version of the code written bij Kim Asendorf. It is written in Processing language, and requires a folder called ‘data’ in the same location as the .pde processing file. I used it to experiment with different images to discover what would happen. |
<nowiki> | <nowiki> |
Revision as of 16:15, 2 February 2018
Project (WORK IN PROGRESS)
I ran into a couple of gifs that visualised how certain sorting algorithms worked. Normally I don’t understand algorithms, but these visualisations made it so easy and insightful to understand what is going on. Besides that I think it’s cool to see an algorithm at work like this, I also think it has some artistic value. You could call it glitch art (glitch art:——————)
These are some examples of different codes working on a color palette:
File:Https://i.imgur.com/rWFaMvP.gifv
It is a code creating a new kind of image by rearranging the original. This results in an image made anonymous. Or maybe more like a vague memory, where everything is still there but over time you start to forget what it looks like. This creates a new memory, a distorted version of the original.
What is Pixel Sorting?
Pixel Sorting is done with a program called Processing. It takes the pixels in a digital image and places them into a semblance of order. Pixel sorting was made popular by an artist of the name Kim Asendorf. He began sorting by developing a code in Processing.
Examples from artists/reddit
Experiment
This is a modified version of the code written bij Kim Asendorf. It is written in Processing language, and requires a folder called ‘data’ in the same location as the .pde processing file. I used it to experiment with different images to discover what would happen.
PImage img; PImage sorted; int index = 0; void setup() { size(800, 400); img = loadImage("afbeelding.jpg"); sorted = createImage(img.width, img.height, RGB); sorted = img.get(); } void draw() { println(frameRate); sorted.loadPixels(); // Selection sort! for (int y = 0; y < sorted.height; y++) { float record = -1; int selectedPixel = index; for (int x = index; x < sorted.width; x++) { int loc = y * sorted.width + x; color pix = sorted.pixels[loc]; float b = brightness(pix); if (b > record) { selectedPixel = loc; record = b; } } // Swap selectedPixel with i color temp = sorted.pixels[y * sorted.width + index]; sorted.pixels[y * sorted.width + index] = sorted.pixels[selectedPixel]; sorted.pixels[selectedPixel] = temp; } if (index < sorted.width -1) { index++; } else { save("sorted.jpg"); frameRate(0); } sorted.updatePixels(); background(0); image(img, 0, 0); image(sorted, 400, 0); }
The code results in a pixel sorting visualisation:
GIF MAKEN