String[] imgNames = {"ce_e_iubirea_illustration.png"};
img = loadImage(imgNames[imgIndex]);
if (imgIndex >= imgNames.length) {
void paintStroke(float strokeLength, color strokeColor, int strokeThickness) {
float stepLength = strokeLength/4.0;
float odds = random(1.0);
tangent1 = random(-strokeLength, strokeLength);
tangent2 = random(-strokeLength, strokeLength);
strokeWeight(strokeThickness);
curve(tangent1, -stepLength*2, 0, -stepLength, 0, stepLength, tangent2, stepLength*2);
for (int num = strokeThickness; num > 0; num --) {
float offset = random(-50, 25);
color newColor = color(red(strokeColor)+offset, green(strokeColor)+offset, blue(strokeColor)+offset, random(100, 255));
strokeWeight((int)random(0, 3));
curve(tangent1, -stepLength*2, z-strokeThickness/2, -stepLength*random(0.9, 1.1), z-strokeThickness/2, stepLength*random(0.9, 1.1), tangent2, stepLength*2);
translate(width/2, height/2);
for (int y = 0; y < img.height; y+=1) {
for (int x = 0; x < img.width; x+=1) {
int odds = (int)random(20000);
color pixelColor = img.pixels[index];
pixelColor = color(red(pixelColor), green(pixelColor), blue(pixelColor), 100);
translate(x-img.width/2, y-img.height/2);
rotate(radians(random(-90, 90)));
paintStroke(random(150, 250), pixelColor, (int)random(20, 40));
} else if (frameCount < 50) {
paintStroke(random(75, 125), pixelColor, (int)random(8, 12));
} else if (frameCount < 300) {
paintStroke(random(30, 60), pixelColor, (int)random(1, 4));
} else if (frameCount < 350) {
paintStroke(random(5, 20), pixelColor, (int)random(5, 15));
} else if (frameCount < 600) {
paintStroke(random(1, 10), pixelColor, (int)random(1, 7));