plotlib
plotlib copied to clipboard
PNG Support
Reading the 1.0 roadmap .png support seems to be planned. Is there anything ongoing for implementing this?
Otherwise, the easiest way seems to rely on an existing svg renderer like librsvg or resvg. Exporting an svg would consists of creating the svg root node, finding good export options and handing those over to the renderer.
The major downside of this approach, despite the increased compile times, is in my opinion the dependency on a system library like cairo or qt. resvg allows to choose from these, librsvg is based on cairo. Thus, it may be appropriate to hide these backends behind feature flags.
As a plus, many more image formats should be exportable. For resvg, I was able to export .bmp, .jpg, .png and probably more.
I could offer a hand for implementing this, just let me know about your preferences.
resvg
looks good. If there is no better solution (e.g. a pure rust library) I would say go for it, although I don't have the final say about what gets merged. @mindriot101 @milliams what do you think?
I think that using something like resvg
makes sense. I'd like to keep plotlib and its dependencies as pure-rust as possible in general but that shouldn't get too much in the way of adding features.
Is this on the roadmap for a future release / are you interested in PR's for adding resvg
?