We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › copy() transparent PNG
Page Index Toggle Pages: 1
copy() transparent PNG (Read 526 times)
copy() transparent PNG
Aug 27th, 2008, 7:23am
 
hello there
I am trying to load a transparent PNG into a variable and then I am putting that image into another image. But the problem is the transparent parts of the PNG does not copy correctly.

here is the screenshot
http://www.serkanaksu.com/test.jpg

here is the code

PImage img1;
PImage img2;

void setup()
 {
   size(300,300);
   img1 = loadImage("back.jpg");    
   img2 = loadImage("fish.png");
   img1.copy(img2,0,0,160,160,0,0,160,160);
 }
 
 
void draw()
 {
   image(img1,0,0);    
 }
Re: copy() transparent PNG
Reply #1 - Aug 27th, 2008, 4:49pm
 
copy() reference page: "No alpha information is used in the process"
You probably want to try blend() instead.
Re: copy() transparent PNG
Reply #2 - Aug 27th, 2008, 8:12pm
 
PhiLho  wrote on Aug 27th, 2008, 4:49pm:
copy() reference page: "No alpha information is used in the process"
You probably want to try blend() instead.


uh oh. ok i'll try.
Page Index Toggle Pages: 1