I was wondering if anyone can be amazing and help me with something I'm working on in Processing
. I need to play a video file with transparencies over a live feed so that the video isn't simply a rectangle. Here is the section of the code that I think I need to add something to or change. I'm extremely new to all of this and I'm extremely grateful to anyone that can help.
相关问题
- applying variable to screen size on processing 3
- How can I draw transparent lines where the color b
- Is there any way to fix the horrendous toolbar ico
- Get value from an Arraylist of Objects - processin
- Processing OBJ extract vertex
相关文章
- Alpha blending with multiple textures leaves color
- How to set bitmap to ARGB_8888 in android?
- How to convert pixels to gray scale?
- ggplot2: different alpha values for border and fil
- How to read oni file in Processing 2?
- Transform from relative to world space in Processi
- How to open PNG with CImg library without losing a
- How to correctly set alpha of UIView? [iOS]
If you're video has an alpha channel, that's great, otherwise, you should be able to blend() the other content.
Here's a basic proof of concept sketch. It overlays a grid of circles on top of a live feed. Use the space key to cycle though blend modes. Some will work better than others depending on your content and what you're trying to achieve:
I solved (maybe can be improved) by using 2 videos: first footage is the color map with white color on the background; second footage is the matte mask: white for the "important" part, and black the others. Then apply mask() function, herunder is the important part of the code:
The video used for the test was 256x256, I always use power of two numbers for better performance (float maths). Hope this helps someone!