Image Transparency
in
Programming Questions
•
1 year ago
I'm having trouble with drawing a .png file. The image is a blurred red circle with transparency. However, the transparency only paints in black. Here's a very simple version of my program that illustrates the problem:
PGraphics pg;
PImage blob = new PImage(100, 100, ARGB);
void setup() {
size(400, 400);
background(255);
pg = createGraphics(width, height, P2D);
blob = loadImage("blob.png");
}
void draw() {
pg.beginDraw();
pg.image(blob, mouseX, mouseY);
pg.endDraw();
image(pg, 0, 0);
}
I don't want to erase the "blob" with background. I'm basically trying to create a paintbrush program where you can load your own paintbrushes.
PGraphics pg;
PImage blob = new PImage(100, 100, ARGB);
void setup() {
size(400, 400);
background(255);
pg = createGraphics(width, height, P2D);
blob = loadImage("blob.png");
}
void draw() {
pg.beginDraw();
pg.image(blob, mouseX, mouseY);
pg.endDraw();
image(pg, 0, 0);
}
I don't want to erase the "blob" with background. I'm basically trying to create a paintbrush program where you can load your own paintbrushes.
1