xxxxxxxxxx
74
let pain
function preload() {
pain = loadImage('night.jpeg');
}
function setup() {
createCanvas(50, 40);
pain.width=width
pixelDensity(1)
}
function draw() {
background(220);
pain.loadPixels()
loadPixels()
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
let i = (x + y * width) * 4;
//tone and pitch of painting
if ((pain.pixels[i + 0])<13){
console.log("----not b")
console.log(pain.pixels[i + 0])
// notbright()
}
else{
// bright()
console.log("----b")
console.log(pain.pixels[i + 0])
}
// //reds
// if (pixels[i + 0] > 120) {
// console.log("red")
// }
// else{
// console.log("not red")
// }
// //greens
// if (pixels[i + 1] > 120) {
// console.log("green")
// }
// else{
// console.log(" not green")
// }
// //blues
// if (pixels[i + 2] > 120) {
// console.log("blue")
// }
// else{
// console.log("not blue")
// }
// if (pixels[i + 0] < 25 && pixels[i + 1] < 25 && pixels[i + 2] < 25) {
// //dark()
// }
// if (pixels[i + 0] > 225 && pixels[i + 1] > 225 && pixels[i + 2] > 225) {
// //white()
// }
}
}
image(pain, 0,0)
}