Last active
September 19, 2019 22:44
-
-
Save Morpholux/ee35a4628d576b32837662cb06136bb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// renaud.jean-francois(arobas)uqam(point)ca | |
// Syntaxe Processing version 3.5.3 | |
// jeudi, 19 septembre 2019 | |
/* | |
Remake of an effect that I saw in a post on Facebook. | |
https://www.facebook.com/groups/creativecodingp5/permalink/2371544796426883/ | |
*/ | |
PImage img; | |
int stepSize; | |
void setup() { | |
img = loadImage("filip-mroz-180859-unsplash-sqr.jpg"); | |
surface.setSize(img.width, img.height); | |
background(0); | |
fill(255); | |
noStroke(); | |
noLoop(); | |
stepSize = round(img.width / 80.0); | |
//println(stepSize); | |
} | |
void draw() { | |
background(img); | |
for (int i = 0; i < width; i+=stepSize) { | |
if ((i > stepSize) && (i < width-stepSize)) { | |
copy(img, i-int(stepSize*1.5), 0, (stepSize*3), img.height, i-int(stepSize*0.5), 0, stepSize, height); | |
} | |
} | |
// border | |
fill(8, 24, 24); | |
rect(0,0,width,20); | |
rect(0,0,20,height); | |
rect(width-20,0,20,height); | |
rect(0,height-20,width,20); | |
// export | |
// save("rendu_processing_effet_verre_cannele.jpg"); | |
} |
Very nice. Thanks for sharing.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Image file to be put in the data folder: