Created
March 11, 2020 08:27
-
-
Save hysysk/eefd14eba76747932ef88c54f5b40426 to your computer and use it in GitHub Desktop.
To export a black and white color layer with blend mode "Screen".
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
PImage img = loadImage("noise_bw.png"); | |
PImage out = createImage(img.width, img.height, ARGB); | |
img.loadPixels(); | |
out.loadPixels(); | |
for(int i=0; i<img.width; i++) { | |
for(int j=0; j<img.height; j++) { | |
color c = img.pixels[j+i*img.width]; | |
float a = brightness(c); | |
out.pixels[j+i*img.width] = color(255, 255, 255, a); | |
} | |
} | |
out.updatePixels(); | |
out.save("noise.png"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment