Skip to content

Instantly share code, notes, and snippets.

@jacobjoaquin
Created June 2, 2016 15:02
Show Gist options
  • Save jacobjoaquin/5c422ac09b9b4b11c6f99047b2bf1621 to your computer and use it in GitHub Desktop.
Save jacobjoaquin/5c422ac09b9b4b11c6f99047b2bf1621 to your computer and use it in GitHub Desktop.
Cycles the Hue of Andy Warhol's Marilyn Monroe Screen Print
PImage img;
int hueOffset = 0;
void setup() {
img = loadImage("warholMarilyn.jpg");
surface.setSize(img.width, img.height);
colorMode(HSB);
}
void draw() {
loadPixels();
for (int i = 0; i < pixels.length; i++) {
int h = ((int) hue(img.pixels[i]) + hueOffset) % 256;
pixels[i] = color(h, saturation(img.pixels[i]), brightness(img.pixels[i]));
}
updatePixels();
hueOffset = (hueOffset + 1) % 256;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment