|
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
|
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.
|
|
|
|
|