Skip to content

Instantly share code, notes, and snippets.

@Morpholux
Last active September 19, 2019 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Morpholux/ee35a4628d576b32837662cb06136bb9 to your computer and use it in GitHub Desktop.
Save Morpholux/ee35a4628d576b32837662cb06136bb9 to your computer and use it in GitHub Desktop.
// 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");
}
@Morpholux
Copy link
Author

Morpholux commented Sep 19, 2019

Image file to be put in the data folder:

filip-mroz-180859-unsplash-sqr

@Morpholux
Copy link
Author

And the result you will obtain :

rendu_processing_effet_verre_cannele

@robinparmar
Copy link

Very nice. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment