Skip to content

Expose compression and filter PNG options through savefig #5397

Closed

Description

@mdboom

As a follow-on to #5389.

JPG saving already has some JPG-specific options. We just need to follow that pattern again for PNG.

Activity

  1. modified the milestone: on Nov 5, 2015
  2. inviridi commented on Sep 29, 2017

    @inviridi

    Would be very useful indeed to trade off file size and image quality before the export.

  3. anntzer commented on Sep 29, 2017

    @anntzer
    Contributor

    I think file size optimization should remain the realm of tools such as pngcrush and optipng.

  4. inviridi commented on Oct 1, 2017

    @inviridi

    Definitely see your point, @anntzer - do one thing and do it well - but MPL is such a feature-rich tool that it would be a pity to miss this. Otherwise, let's get rid of the JPG options and the animation support. People can stitch their animations together by hand, too. Actually, who needs JPG anyway? Users could convert it from PNG...

  5. anntzer commented on Oct 1, 2017

    @anntzer
    Contributor

    Good luck stitching animations by hand. To get any reasonable performance you need to pipe the raw buffers to the encoder... which can be done, but is far from trivial. Similarly (though less so) for jpeg.
    OTOH if you really care about your png file size, the optimization size is going to be by far the slowest, so it's fine just to rely on an external tool.

    Still, I didn't say I would veto a PR implementing this...

  6. modified the milestones: , on Oct 1, 2017
  7. tacaswell commented on Oct 1, 2017

    @tacaswell
    Member

    Please keep the comments here civil and avoid sarcasm.

    This is reasonable feature to want, but given that it can be handled via external tools is not the highest priority (as you can infer that this is ~2 years old).

    @eggsperde I would be happy to review a PR adding this feature.

  8. inviridi commented on Oct 1, 2017

    @inviridi

    No offense/sarcasm taken!

    It seems that PNG only has one compression variable ("speed/compression ratio"). The resulting image is always lossless. For more compression we'd have to look to external programs. I honestly thought there would be more to it.

    I am currently in the final stretch of writing a thesis, but would like to give this a shot once I have a real life again.

  9. tacaswell commented on Oct 2, 2017

    @tacaswell
    Member

    @eggsperde Best of luck finishing the thesis!

  10. philmaweb commented on Nov 8, 2018

    @philmaweb

    any progress towards this feature request?

  11. modified the milestones: needs sorting, v3.1 on Jan 18, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions