Skip to content

[ENH]: saving images in webp format #21162

Closed

Description

@LinasNas

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

Activity

  1. jklymak commented on Sep 23, 2021

    @jklymak
    Member

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

  2. added
    🌱 Good first issueOpen a pull request against these issues if there are no active ones!
    on Sep 30, 2021
  3. AtulKarn commented on Oct 1, 2021

    @AtulKarn

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

  4. jklymak commented on Oct 1, 2021

    @jklymak
    Member

    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.

  5. timhoffm commented on Oct 1, 2021

    @timhoffm
    Member

    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.

  6. AtulKarn commented on Oct 1, 2021

    @AtulKarn

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

  7. ShubhitSardana commented on Oct 1, 2021

    @ShubhitSardana

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

  8. timhoffm commented on Oct 1, 2021

    @timhoffm
    Member

    @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.

  9. AtulKarn commented on Oct 2, 2021

    @AtulKarn

    @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

  10. aitikgupta commented on Oct 2, 2021

    @aitikgupta
    Contributor

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

  11. remram44 commented on Oct 3, 2021

    @remram44
    Contributor

    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

  12. dewanshrawat15 commented on Oct 3, 2021

    @dewanshrawat15

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

  13. ShubhitSardana commented on Oct 3, 2021

    @ShubhitSardana

    @AtulKarn OK I'll wait take your time

  14. added this to the v3.6.0 milestone on Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    New feature🌱 Good first issueOpen a pull request against these issues if there are no active ones!

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions