Created
March 11, 2016 13:37
-
-
Save dyln/2dee416818a1fd488a98 to your computer and use it in GitHub Desktop.
image decomp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PImage portre; | |
| void setup(){ | |
| size(800,600); | |
| portre = loadImage("keko.jpg"); | |
| colorMode(HSB,100); | |
| } | |
| void draw(){ | |
| background(0); | |
| portre.resize(600,0); | |
| image(portre, 0,0); | |
| //println(portre.width + " - " + portre.height); | |
| //int pickedColor = portre.get(mouseX, mouseY); | |
| //fill(pickedColor); | |
| //rect(0,0,50,50); | |
| for(int i=0; i<portre.width;i++){ | |
| for(int j=0;j<portre.height;j++){ | |
| color currentColor = portre.get(i,j); | |
| if(brightness(currentColor)<27) | |
| portre.set(i,j,color(50,100,100)); | |
| else if(brightness(currentColor)<50) | |
| portre.set(i,j,color(70,100,100)); | |
| else if(brightness(currentColor)<70) | |
| portre.set(i,j,color(100,100,100)); | |
| } | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
need to have an image file in data directory