Cris D

Generation

generate functionTue, 16 May 2023

Ponerle sombra a un linear

PImage img = loadImage("img.jpg"); img.loadPixels(); for(int i=0; i<img.width; i++) { for(int j=0; j<img.height; j++) { int c = img.get(i, j); float r = red(c); float g = green(c); float b = blue(c); float a = alpha(c); float newR = 0; float newG = 0; float newB = b * .7; float newA = a; newR += newR * 0.5; newB += newB * 0.5; newG += newG * 0.5; img.set(i, j, color(newR, newG, newB, 255)); } } img.updatePixels(); image(img, 0, 0, 640, 480);

Questions about programming?Chat with your personal AI assistant