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 & HelpVideo Capture,  Movie Playback,  Vision Libraries › can we change the alpha or opacity of capture
Page Index Toggle Pages: 1
can we change the alpha or opacity of capture? (Read 1016 times)
can we change the alpha or opacity of capture?
Nov 27th, 2007, 9:00am
 
can we change the alpha or opacity of capture, i am trying to do some effect that follows movements and there is a background this may be a logo of some company

i just want to show background image and effects according to my movement...
Re: can we change the alpha or opacity of capture?
Reply #1 - Nov 27th, 2007, 10:36am
 
Capture class extends PImage, so you can do just the same with a Capture object as with a PImage object:

http://processing.org/reference/PImage_mask_.html
http://processing.org/reference/tint_.html

F
Re: can we change the alpha or opacity of capture?
Reply #2 - Nov 27th, 2007, 10:44am
 
but i am using JMyron Sad
Re: can we change the alpha or opacity of capture?
Reply #3 - Nov 27th, 2007, 11:51am
 
// JMyron m; // = a camera object

// in draw():

m.update();//update the camera view
 int[] img = m.image(); //get the normal image of the camera

//draw what the camera sees
 loadPixels();
 for(int i=0;i<width*height;i++){
   pixels[i] = color( red(img[i]), green(img[i]), blue(img[i]), 127);
 }
 updatePixels();


or


pixels[i] = (127 << 24) + ( img[i] & 0xFFFFFF );  // 127 = alpha 50%


F
Re: can we change the alpha or opacity of capture?
Reply #4 - Nov 27th, 2007, 1:00pm
 
I understand thank u so much Smiley

i have tried it but it is affecting whole scence, for example when I load some image, its alpha value is being the same with camera...
Page Index Toggle Pages: 1