Skip to content

Instantly share code, notes, and snippets.

@nakamura001
Created August 21, 2012 06:23
Show Gist options
  • Save nakamura001/3412601 to your computer and use it in GitHub Desktop.
Save nakamura001/3412601 to your computer and use it in GitHub Desktop.
[Processing]アルファによる透過処理付きの画像生成
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