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

alpha transparency #47

Open
mrglennjones opened this issue Jan 21, 2025 · 2 comments
Open

alpha transparency #47

mrglennjones opened this issue Jan 21, 2025 · 2 comments

Comments

@mrglennjones
Copy link

when displaying png files with an alpha transparency channel, the transparency isnt shown, instead its, just solid back pixels.

this would be useful for over laying graphics on top of each over

@Gadgetoid
Copy link
Member

I think we've got appetite to add alpha blending, but it will be a fair amount of work and will have a significant impact on performance when you use it.

Things like the "fade in and out" mentioned in #48 would work, but an alpha blend requires reading pixels, performing (read: trying very hard to avoid floating point) maths and writing them back which is going to be slow in comparison to opaque pixels (which can be slammed into the framebuffer very quickly using optimised routines).

This is evident when turning on anti-aliasing for PicoVector, which alpha blends the edge pixels using a specific written-just-for-vector-graphics drawing routine. You can feel the performance cost for just the edges, so imagine doing the whole object!

@mrglennjones
Copy link
Author

I think we've got appetite to add alpha blending, but it will be a fair amount of work and will have a significant impact on performance when you use it.

Things like the "fade in and out" mentioned in #48 would work, but an alpha blend requires reading pixels, performing (read: trying very hard to avoid floating point) maths and writing them back which is going to be slow in comparison to opaque pixels (which can be slammed into the framebuffer very quickly using optimised routines).

This is evident when turning on anti-aliasing for PicoVector, which alpha blends the edge pixels using a specific written-just-for-vector-graphics drawing routine. You can feel the performance cost for just the edges, so imagine doing the whole object!

yes i figured it could be a bit of a processor hogger, thought id mentioned anyway, just incase you can perform some magic :)

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

2 participants