globalAlpha and image transparency
Hi, great work on this library !
The performance on the pi seems great running over video.
One question I have is regarding image alpha / globalAlpha. It seems that globalAlpha does not seem to work on images. I am able to grab the image data and iterate over the RGBA values and set the alpha like that - but this seems quite slow from within node at least. What would you suggest as a better alternative ? And is it something you plan to add support for. i.e. globalAlpha for images.
Also animating images with alpha has a performance hit (actually it's still not too bad). but is there some optimisation you could suggest ?
Actually I just noticed something related to animating images - I think the issue is related to putImageData vs drawImage,
when animating drawImage seems smoother / faster.
Thank you for the feedback!
Hi, globalAlpha should be supported. I'll take a look at that.
Regarding performance: Anything done on the JS side tends to be fairly slow. I'll investigate the drawImage vs putImageData and get back to you.
@pixelami You mention that you were able to get a canvas over video on the pi. How did you achieve this? Thanks ahead of time.
@luismreis I am not able to get globalAlpha to work too. I have tried 1, 0.5, 0.1 and 0, but the subsequent drawImage still draws an opaque image.
I am using NodeJS v0.10.15 and openvg-canvas v1.1.7 by the way (I installed openvg-canvas via npm).
Hi, sorry for late response I had to make a small hack in node-openvg that basically created the drawing surface on layer 1 instead of layer 0. https://github.com/luismreis/node-openvg/blob/master/src/egl.cc#L92
Then I can launch e.g. omxplayer and have my canvas rendering on top.
A.
On Wed, May 1, 2013 at 8:05 PM, Mark Losey [email protected] wrote:
@pixelami https://github.com/pixelami You mention that you were able to get a canvas over video on the pi. How did you achieve this? Thanks ahead of time.
— Reply to this email directly or view it on GitHubhttps://github.com/luismreis/node-openvg-canvas/issues/9#issuecomment-17299687 .
@luismreis,
Hello Luis, I am not able to get globalAlpha to work on images. Any chance you may have some insight on how to go about this?
Thanks!
Vic