Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage myImage;
- color col;
- float sw, br, incr;
- void setup() {
- background(0);
- colorMode(HSB, 100);
- myImage = loadImage("pal1.gif");
- size(myImage.width, myImage.height);
- myImage.loadPixels();
- incr = 5;
- }
- void draw() {
- background(0);
- for (int x = 0; x<width; x += incr) {
- for (int y = 0; y < height; y += incr) {
- col = myImage.pixels[y*width+x];
- sw = map(brightness(myImage.get(x, y)), 0, 100, 1, 20) ;
- br = brightness(myImage.get(x, y));
- stroke(myImage.get(x, y), 150);
- strokeWeight(sw);
- point(x,y);
- }
- }
- }
- void keyPressed() {
- save(random(123)+".png");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement