Preview: When Computers create Collages
2023-12-01 Today I want to share with you a first prototype that will be the basis for a new course that will probably be called “When Computers create Collages”. In this application, a stack of images is loaded and transformed into any number of computer-generated collages.
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/037-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/051-1-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/081-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/089-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/180-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/276-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/234-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/298-1024x1024.jpg)
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/155-1024x1024.jpg)
int amount = int(random(5, 25));
PGraphics[] layers = new PGraphics[amount];
PGraphics[] masks = new PGraphics[amount];
import java.io.File;
String [] imageFileNames;
StringList images;
void setup() {
size(1200, 900);
java.io.File folder = new java.io.File(dataPath("images"));
imageFileNames = folder.list();
images = new StringList();
println("loading...");
// Load the image-files and push thems to imagess-arrayList
for (int i = 0; i < imageFileNames.length; i++) {
String filename = imageFileNames[i];
if (filename.indexOf("Store") == -1) {
images.push("data/images/"+filename);
}
}
println(images.size() + " images loaded!");
for (int i = 0; i < layers.length; i++) {
layers[i] = createGraphics(width, height);
masks[i] = createGraphics(width, height);
}
}
PGraphics l, m;
PImage img;
void draw() {
amount = int(random(3, 30));
background(0);
//blendMode(SCREEN);
for (int i = 0; i < layers.length; i++) {
l = layers[i];
img = loadImage(images.get(int(random(images.size()))));
img.resize(width, 0);
l.beginDraw();
l.clear();
l.push();
l.image(img, 0, 0);
l.pop();
l.endDraw();
m = masks[i];
m.beginDraw();
m.background(#FFFFFF);
m.noStroke();
m.fill(0);
m.beginShape();
for (int j = 0; j < 12; j++) {
float x = random(-width, width*2);
float y = random(-height, height*2);
m.curveVertex(x, y);
}
m.endShape();
if (random(1) < 0.1) {
m.circle(random(width), random(height), random(width/2));
}
m.endDraw();
l.mask(m);
image(l, 0, 0);
}
saveFrame("out/###.png");
}
Related
![](https://timrodenbroeker.de/wp-content/uploads/2024/07/Sam-2.jpg)
In this post I’d like to introduce you to Sam Griffith, a talented graphic designer based in Detroit, to discuss […]
![](https://timrodenbroeker.de/wp-content/uploads/2024/07/tnd.jpg)
The next edition of the DEMO Festival is already approaching and I am currently developing a brand new talk for […]
![](https://timrodenbroeker.de/wp-content/uploads/2024/07/lenaw.gif)
20 = 1 21 = 222 = 323 = 824 = 1625 = 3226 = 6427 = 128 … »In […]
![](https://timrodenbroeker.de/wp-content/uploads/2024/05/omidthumb.gif)
In 2022, I spontaneously posted a story on Instagram: If anyone out there is also in Rotterdam, I’d love to […]
![](https://timrodenbroeker.de/wp-content/uploads/2024/03/snippet4glass-ezgif.com-optimize.gif)
Lena: This 10-minute visualiser for A. G. Cooks album teaser featuring my python archive generator, is one of my favourite […]
![](https://timrodenbroeker.de/wp-content/uploads/2024/01/Tay-Papon-Punyahotra.gif)
One of the first exercises I assign to my students in my seminars is called “Random Compositions”. Basically, it’s quite […]
![](https://timrodenbroeker.de/wp-content/uploads/2023/09/mockup1.gif)
For my students at Elisava, I have created a new version of my mockup-tool. You need two different files for […]
![](https://timrodenbroeker.de/wp-content/uploads/2023/11/randomcompos.gif)
One of the most exciting and maybe even unsettling discoveries in the learning process of Creative Coding in Graphic Design […]