Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globalAlpha and image transparency #9

Open
pixelami opened this issue Mar 4, 2013 · 6 comments
Open

globalAlpha and image transparency #9

pixelami opened this issue Mar 4, 2013 · 6 comments

Comments

@pixelami
Copy link

pixelami commented Mar 4, 2013

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 ?

@pixelami
Copy link
Author

pixelami commented Mar 4, 2013

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.

@eendeego
Copy link
Owner

eendeego commented Mar 5, 2013

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.

@markalosey
Copy link

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

@kokhoor
Copy link

kokhoor commented Aug 16, 2013

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

@pixelami
Copy link
Author

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//issues/9#issuecomment-17299687
.

@ghost
Copy link

ghost commented Oct 21, 2013

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants