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

Image encoding API #204

Closed
padenot opened this issue Apr 29, 2021 · 7 comments
Closed

Image encoding API #204

padenot opened this issue Apr 29, 2021 · 7 comments
Labels
extension Interface changes that extend without breaking. image issues related to image decoding and encoding obsolete Looks like it might be obsolete

Comments

@padenot
Copy link
Collaborator

padenot commented Apr 29, 2021

#152 is the initial PR adding image decoding support, but image encoding needs to be added to the spec.

@padenot padenot added the image issues related to image decoding and encoding label Apr 29, 2021
@dalecurtis
Copy link
Contributor

Seems reasonable, the existing image encoding path only operates on canvas:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob

@chcunningham chcunningham added the extension Interface changes that extend without breaking. label May 12, 2021
@talltyler
Copy link

Canvas.toBlob does not address any file format that supports animation. For static images this is fine but it would be incredibly useful to combine a bunch of VideoFrames into a GIF or animated PNG.

@dalecurtis
Copy link
Contributor

dalecurtis commented May 11, 2023

FWIW, you can assemble an aPNG from multiple toBlob("image/png") calls IIUC. Your point stands for GIF though. The wrinkle is that UAs generally don't ship a GIF encoder already, so adding new formats isn't always easy.

@dalecurtis
Copy link
Contributor

Since I was curious if it could actually be done, here's a demo assembling an APNG from PNG files for those curious: https://dalecurtis.github.io/apng-assemble/
https://github.com/dalecurtis/dalecurtis.github.io/tree/master/apng-assemble

@talltyler
Copy link

Thank you, this is truly very helpful.
I still think having an ImageEncoder could with a common interface that could make use of VideoFrames could be even more useful but for now this is better than what I'm currently doing.

@Djuffin Djuffin added the obsolete Looks like it might be obsolete label Sep 28, 2023
@aboba
Copy link
Collaborator

aboba commented May 8, 2024

@Djuffin @padenot Can we close this?

@Djuffin
Copy link
Contributor

Djuffin commented May 8, 2024

No progress and no plans on this issue for 3 years.

@Djuffin Djuffin closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Interface changes that extend without breaking. image issues related to image decoding and encoding obsolete Looks like it might be obsolete
Projects
None yet
Development

No branches or pull requests

6 participants