/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.tMK4IrxPQdc/rev.109
*
* authors:
* Fun Programming
*
*
*
*
*
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// Watch a video tutorial about this program:
// http://funprogramming.org/90-Change-pixel-hue-saturation-and-brightness.html
/* @pjs preload="/static/uploaded_resources/p.1811/uganda.jpg"; */
void setup() {
size(500, 400);
colorMode(HSB);
PImage img = loadImage("/static/uploaded_resources/p.1811/uganda.jpg");
image(img, 0, 0);
}
void draw() {
loadPixels();
for(int i = 0; i<pixels.length; i++) {
float b = brightness(pixels[i]);
float s = saturation(pixels[i]);
float h = hue(pixels[i]);
pixels[i]=color(0.95*h,s,b)
}
updatePixels();
}