Created
May 13, 2018 03:31
-
-
Save gifguide2code/9e433da0d4adead40005eb6108c18e23 to your computer and use it in GitHub Desktop.
This sketch pulls out messages hidden by the Static-Cipher.pde.
This file contains 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
void setup() { | |
size(600,600); | |
PImage Garbled = loadImage("Message.png"); | |
PImage Message = createImage(width,height,ARGB); | |
Garbled.loadPixels(); | |
for (int x = 0; x<width;x++) { | |
for (int y = 0; y <height; y++) { | |
int loc = x + y*width; | |
float r = red(Garbled.pixels[loc]); | |
float g = green(Garbled.pixels[loc]); | |
float b = blue(Garbled.pixels[loc]); | |
if((r==100) && (g==100) && (b==100)) { | |
Message.pixels[loc] = color(0); | |
} else { | |
Message.pixels[loc] = color(255); | |
} | |
} | |
} | |
Message.updatePixels(); | |
image(Message,0,0); | |
} | |
void draw() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment