FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Alpha mask
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Alpha mask  (Read 307 times)
clevo


Alpha mask
« on: Mar 30th, 2004, 8:01am »

I've been trying to drop the background from around a jpg image. It's RGB on a white background. I have been using a black and white grey scale image for the mask saved in either jpg of gif. I've used the methods suggested in the reference but nothing happens. Is there some mystic secret to this process. Could someone enlighted me with a simple sample of some code I could play with that actually works.
 
JohnG

WWW
Re: Alpha mask
« Reply #1 on: Mar 30th, 2004, 12:03pm »

on Mar 30th, 2004, 8:01am, clevo wrote:
I've been trying to drop the background from around a jpg image. It's RGB on a white background. I have been using a black and white grey scale image for the mask saved in either jpg of gif. I've used the methods suggested in the reference but nothing happens. Is there some mystic secret to this process. Could someone enlighted me with a simple sample of some code I could play with that actually works.

 
I've managed to make and use alpha masks on the fly, so they should work.
Here's some code that should work:
void setup()
{
  size(200,200);
  BImage Image=loadImage("Image1.jpg"); //the image
  BImage Alpha=loadImage("Image1.gif"); //the alpha mask
  Image.alpha(Alpha);
  background(color(128,128,128 ));
  image(Image,32,32);
}
 
You can see it in practice here: http://www.hardcorepawn.com/Alpha/
 
clevo


Re: Alpha mask
« Reply #2 on: Mar 30th, 2004, 11:35pm »

I found out what the problem was, I was using 0067 version of the software which does not work.
 
Pages: 1 

« Previous topic | Next topic »