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

webp rendering support #7360

Open
mpeyfuss opened this issue Nov 5, 2024 · 6 comments
Open

webp rendering support #7360

mpeyfuss opened this issue Nov 5, 2024 · 6 comments

Comments

@mpeyfuss
Copy link

mpeyfuss commented Nov 5, 2024

Topic

GIFs play just fine when using loadImage but webp images do not. Is this something that is planned for the future? Webp format is becoming more prevalent and is a great GIF alternative for smaller & faster files.

Copy link

welcome bot commented Nov 5, 2024

Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!

@davepagurek
Copy link
Contributor

One option for right now is to use createImg to create a DOM element instead of loadImage (aside: we need to fix the reference example for that 😬) You can either display the element on top of the canvas, or call .hide() on it and draw it to the canvas using image(yourElement, x, y) like any other image and I believe that should work.

The main thing you lose out on is the ability to manually control the playback of the animation, as that requires parsing the frames out of the image file. If someone has made a webp parsing library we could leverage, then adding support for animated webp could be feasible.

@mpeyfuss
Copy link
Author

mpeyfuss commented Nov 5, 2024

Yeah, taking a closer look at all the gif code now. Would be good to be able to reuse the code for gifs if possible. Will do some more research!

@SDprogramer
Copy link

Hey, I want to contribute in this issue.
And being first time in open source development ca you please suggest me how to contribute to this and the steps related to.

@asukaminato0721
Copy link
Contributor

If someone has made a webp parsing library

I found this https://github.com/antimatter15/weppy

@Rishab87
Copy link
Contributor

If someone has made a webp parsing library we could leverage, then adding support for animated webp could be feasible.

Ig we can use this: https://github.com/jhuckaby/webp-wasm, with this library we can decode animated WebP to extract frames for rendering in p5.js.

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

No branches or pull requests

5 participants