Skip to content

[ENH]: saving images in webp format #21162

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

Closed
LinasNas opened this issue Sep 23, 2021 · 12 comments · Fixed by #21274
Closed

[ENH]: saving images in webp format #21162

LinasNas opened this issue Sep 23, 2021 · 12 comments · Fixed by #21274
Labels
Good first issue Open a pull request against these issues if there are no active ones! New feature
Milestone

Comments

@LinasNas
Copy link

Problem

I've noticed that matplotlib currently doesn't support saving images in webp format, which I later confirmed by looking into supported file formats in backend_bases.py file.

Saving images in webp would definitely be useful for users who want to upload the graphs they generate in matplotlib to the web. Compression to webp helps significantly reduce the image size, without losing quality. More information about webp can be found here.

Proposed solution

Would it be possible to add webp as a supported image saving format? It seems that Pillow package is automatically installed as a dependency when installing matplotlib. Pillow makes it relatively easy to convert an image to webp using the save() method. More detailed information can be found in the documentation

Additional context and prior art

No response

@jklymak
Copy link
Member

jklymak commented Sep 23, 2021

I think if pillow supports this, it is a pretty easy thing to add.

@timhoffm timhoffm added the Good first issue Open a pull request against these issues if there are no active ones! label Sep 30, 2021
@AtulKarn
Copy link

AtulKarn commented Oct 1, 2021

Can I work on this issue? I am new to open source and it looks like a good place to start

@jklymak
Copy link
Member

jklymak commented Oct 1, 2021

Hi @AtulKarn Yes. Please read our contributing guide. Otherwise, we do not "assign" issues, so feel free to make a PR. In terms of etiquette, it is fine for anyone to submit a PR, but once a PR is submitted, it is usually preferable to work with the original PR author than submit a competing PR.

@timhoffm
Copy link
Member

timhoffm commented Oct 1, 2021

It's also good to comment that you have started working on a PR to prevent accidental duplicate work. But as said, you don't have to ask to work on something.

@AtulKarn
Copy link

AtulKarn commented Oct 1, 2021

Thanks for the response. I will work on this and read the guide and also ask if I have any difficulties.

@ShubhitSardana
Copy link

Hey, can I work on this? I am new to open source and wanted to start from here.

@timhoffm
Copy link
Member

timhoffm commented Oct 1, 2021

@Critical07 please note that @AtulKarn has announced that he'll be working on the issue. Please coordinate with him to prevent duplicate work or choose another issue.

@AtulKarn
Copy link

AtulKarn commented Oct 2, 2021

@Critical07 Hi. I am currently working on this, and if I am unable to do it in a few days, then you can take it. I will mention if I am unable to complete it

@aitikgupta aitikgupta added the hacktoberfest-accepted valid for hacktoberfest but not ready for merging label Oct 2, 2021
@aitikgupta
Copy link
Contributor

Added a hacktoberfest-accepted label, so any related PR will add on to users' contribution count.

@remram44
Copy link
Contributor

remram44 commented Oct 3, 2021

hacktoberfest-accepted is used to mark PRs as accepted, it does nothing on issues. Since this repository has the hacktoberfest topic, it is unnecessary to use the label as merging or approving a PR will already make it count.

See: https://hacktoberfest.digitalocean.com/resources/participation

@jklymak jklymak removed the hacktoberfest-accepted valid for hacktoberfest but not ready for merging label Oct 3, 2021
@dewanshrawat15
Copy link

@jklymak I think Pillow does support saving images in webp. Reference this medium article

@ShubhitSardana
Copy link

@AtulKarn OK I'll wait take your time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Open a pull request against these issues if there are no active ones! New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants