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.
Page Index Toggle Pages: 1
image alpha (Read 2111 times)
image alpha
Jun 10th, 2010, 4:39am
 
Hi,

I try to run this example from the code reference :
http://processing.org/reference/PImage_alpha_.html

Code:

PImage img = loadImage("test.jpg");
PImage alphaImg = loadImage("mask.jpg");
img.alpha(alphaImg);
image(img, 0, 0);
image(img, 25, 0);


I've loaded two images with the same width/height.

I get the following error :
The function alpha(Pimage) does not exist.

Same goes when I make a pixel array with loadPixels.
The function alpha(int[]) does not exist.

Is this code not supported anymore ?


Re: image alpha
Reply #1 - Jun 10th, 2010, 6:09am
 
I don't know how you found this page (old forum post) but if you look at PImage reference, there is no alpha() method.
Look at PImage.mask() instead.
Re: image alpha
Reply #2 - Jun 10th, 2010, 10:10am
 
Page Index Toggle Pages: 1