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

[Feature Request]: Add more Screenshot Formats #6251

Closed
3 tasks done
ShiroYasha456 opened this issue Dec 2, 2024 · 2 comments · Fixed by #6263
Closed
3 tasks done

[Feature Request]: Add more Screenshot Formats #6251

ShiroYasha456 opened this issue Dec 2, 2024 · 2 comments · Fixed by #6263

Comments

@ShiroYasha456
Copy link

Guidelines

  • I have searched the issue tracker for open and closed issues that are similar to the feature request I want to file, without success.
  • I have searched the documentation for information that matches the description of the feature request I want to file, without success.
  • This issue contains only one feature request.

Problem Description

Currently, Freetube only supports JPG and PNG formats. While it might be fine for most people, those looking to save storage might want to save images in a different format that more features including lossy/lossless compression that leads to low file size, less artifacting than typically jpg, lower loss of detail on a glance etc

Proposed Solution

Allow screenshots to be taken in more formats. Particularly the ones I wanna mention are:

  1. webp (It is the most commonly used format around the web right now)
  2. JPEG XL
  3. AVIF

Alternatives Considered

Nothing. Maybe don't add anything new and keep it that way.

Issue Labels

improvement to existing feature, new optional setting

Additional Information

I think 2kiksphilips has a good video on it (even tho google killed jpeg xl in browsers)
https://youtu.be/FlWjf8asI4Y

I'm not good at explaining so maybe someone else can add on what I want to say.

@absidue
Copy link
Member

absidue commented Dec 2, 2024

The only format on that list that we can implement is WebP.

FreeTube uses Electron which is based on Chromium. As you already discovered yourself JPEG XL is not supported in Chromium.

Additionally it looks like Chromium supports displaying AVIF files but not creating them. This Chromium issue (https://issues.chromium.org/issues/40848792) mentions that the low demand for encoding AVIF inside the browser does not justify the increase to Chromium's binary size. I also tested it myself and confirmed that it is unsupported, as it returns a PNG image instead, which is what the Canvas.toBlob spec says that browsers should do if they don't support the requested format, the spec also mentions that browsers are only required to implement support for encoding to PNG https://html.spec.whatwg.org/multipage/canvas.html#serialising-bitmaps-to-a-file. Thankfully most modern browsers support encoding to PNG, JPEG and WebP (https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#browser_compatibility).

@ShiroYasha456
Copy link
Author

I see so encoding to AVIF isn't possible either. I'm happy we can get webp at least. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To assign
Development

Successfully merging a pull request may close this issue.

2 participants