xxxxxxxxxx
var img;
var pixel_bright, pixel_middle_1, pixel_middle_2, pixel_dark;
function preload() {
img = loadImage("B664915F-D65C-40B0-9DD7-B2BC2FD0A3DE.jpeg");
pixel_bright = loadImage("tasche1.jpg");
pixel_middle_1 = loadImage("tasche 3.jpg");
pixel_middle_2 = loadImage("tasche 4.jpg");
pixel_dark = loadImage("Tasche2.jpg");
}
function setup() {
createCanvas(1200, 1600);
//background(0,0,0);
noLoop();
}
function draw() {
//image(img, 0, 0);
img.loadPixels();
for (var y=0; y<img.height; y+=10)
{
for (var x=0; x<img.width; x+=10)
{
var pix = red(img.get(x, y));
if (pix <= 64)
{
image(pixel_dark, x, y, 10, 10);
}
if (pix >= 64 && pix <=128)
{
image(pixel_middle_2, x, y, 10, 10);
}
if (pix >= 128 && pix <=192)
{
image(pixel_middle_1, x, y, 10, 10);
}
if (pix >= 192 && pix <=255)
{
image(pixel_bright, x, y, 10, 10);
}
}
}
}