Created
August 21, 2012 06:23
-
-
Save nakamura001/3412601 to your computer and use it in GitHub Desktop.
[Processing]アルファによる透過処理付きの画像生成
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; | |
void setup() { | |
size(300, 200); | |
img = createImage(width, height, ARGB); | |
for (int y=0; y<img.height; y++) { | |
for (int x=0; x<img.width; x++) { | |
println((float)x/width); | |
img.pixels[y*img.width+x] = color(0, 0, 255, (float)x/width*255); | |
} | |
} | |
img.save("output.png"); | |
imageMode(CENTER); | |
image(img, width/2, height/2); | |
} | |
void draw() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment