Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage img;
- int smallPoint, largePoint;
- void setup() {
- size(360,640);
- // size (1275,2267);
- img = loadImage("naranja.png");
- img.resize(360, 640);
- // img.resize(1275,2267);
- smallPoint = 10;
- largePoint = 50;
- imageMode(CENTER);
- noStroke();
- background(255);
- frameRate (50);
- }
- void draw() {
- float pointillize = map(mouseX, 0, width, smallPoint, largePoint);
- int x = int(random(img.width));
- int y = int(random(img.height));
- color pix = img.get(mouseX, mouseY);
- fill(pix, 128);
- rect(mouseX,mouseY, pointillize, pointillize);
- }
- void mousePressed() {
- saveFrame ("rs-###.jpg");
- }
- void keyPressed() {
- setup();
- redraw();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement