You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose compression and filter PNG options through savefig #5397
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...
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...
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.
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.
Activity
inviridi commentedon Sep 29, 2017
Would be very useful indeed to trade off file size and image quality before the export.
anntzer commentedon Sep 29, 2017
I think file size optimization should remain the realm of tools such as pngcrush and optipng.
inviridi commentedon Oct 1, 2017
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...
anntzer commentedon Oct 1, 2017
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...
tacaswell commentedon Oct 1, 2017
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.
inviridi commentedon Oct 1, 2017
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.
tacaswell commentedon Oct 2, 2017
@eggsperde Best of luck finishing the thesis!
philmaweb commentedon Nov 8, 2018
any progress towards this feature request?