xxxxxxxxxx
41
/*
NE FONCTIONNE PAS
inspiration https://twitter.com/AkiyoshiKitaoka/status/1389828814696378368
IMAGE https://pixabay.com/fr/photos/papillon-fleurs-insectes-p%C3%A9tales-6170999/
v1 pour traiter les pixels
https://medium.com/@colinpatrickreid/creating-impressionistic-art-with-photography-and-p5-js-e073d794aa40
voir aussi https://www.youtube.com/watch?v=FVYGyaxG4To 7.8: Objects and Images de the coding train
voir aussi https://idmnyu.github.io/p5.js-image/Layers/index.html
*/
let img ;
function preload() {
img = loadImage("butterfly_640.jpg");
}
function setup() {
print( img.width, img.height ) ;
image( img, 0, 0 );
/*
img.loadPixels();
for (x = 0; x < img.width; x++) {
for (y = 0; y < img.height; y = y++) {
index = (floor(x) + floor(y) * img.width) * 4;
red = img.pixels[index]
blue = img.pixels[index + 1]
green = img.pixels[index + 2]
alpha = img.pixels[index + 3]
//pixel_brightness = (red + blue + green) / 3
fill(red,blue,green,alpha)
rect(x,y,1,1)
}
}
*/
}