Algorithm for image smoothing
PImage img; int a, b,z,u; void setup() { size(1000, 900); img = loadImage("sun.png"); a = 1; b = 1; z=img.width; u=0; imageMode(CENTER); noStroke(); background(255); } void draw() { float pixel = map(11, 0, width, a, b); int x = int(random(img.width)); int y = int(random(img.height)); color pix = img.get(x, y); fill(pix, 128); rect(x-1, y, pixel, pixel); rect(x+1, y, pixel, pixel); rect(x, y-1, pixel, pixel); rect(x, y+1, pixel, pixel); rect(x, y, pixel, pixel); }
No comments:
Post a Comment