kyamagu / skia-python

Python binding to Skia Graphics Library
https://kyamagu.github.io/skia-python/
BSD 3-Clause "New" or "Revised" License
243 stars 43 forks source link

Question: Matplotlib Backend / Precompiled Skia #163

Open 0lru opened 2 years ago

0lru commented 2 years ago

Hi. I'm currently using your bindings in my project and created a skia-canvas. Works great. Yesterday I thought I could add hardware-accelerated matplotlib-support with that by writing a skia-python backend: Also works.

The question would be: May you have time or interest to develop and optimize the renderer/backend (for matplotlib)? I could imagine that you can do better than me since you know API very well :-). Maybe in an own, dedicated repository?

My rudimentary code is located here: https://github.com/0lru/p3ui/tree/matplotlib_backend/python/p3/matplotlib image

kyamagu commented 2 years ago

Thanks for the great proof-of-concept. Certainly building a matplotlib backend is an interesting idea. Unfortunately, I do not have any capacity in developing / maintaining additional functionality beyond what is in the current code. Even keeping up to date with the upstream Skia is not possible right now.

0lru commented 2 years ago

pitty :-). Anyhow, I'll move it into its own repo soon. Will paste the link then here, although closed. B.t.w.: Love your project.

0lru commented 2 years ago

Some progress. It's missing:

One more question: Other projects which are using Skia compile Skia in their own repo. JetBrains Compose is a good example. Is this also feasible for you? I think I could also help to maintain that.

I will try to create the backend within p3ui. I could then try to push it directly to the matplotlib repo. Doing the "Improve Performance"-issue would help. Currently it looks like: scr1

0lru commented 2 years ago

https://github.com/0lru/p3ui_skia, which is more or less a fork of: https://github.com/JetBrains/skia-build

0lru commented 2 years ago

maybe then download like so: https://github.com/0lru/p3ui/blob/main/extern/skia.py

sherlockdoyle commented 2 years ago

Thanks for the great proof-of-concept. Certainly building a matplotlib backend is an interesting idea. Unfortunately, I do not have any capacity in developing / maintaining additional functionality beyond what is in the current code. Even keeping up to date with the upstream Skia is not possible right now.

@kyamagu, I'm using this for a personal project and would like to maintain this library. Alternately, I'll clone and use this library separately. Either way, can I connect with you regarding the library, given that you've had more experience developing this?

kyamagu commented 2 years ago

@sherlockdoyle You can do whatever you want with skia-python. Feel free to make PRs if you find a bug or something is missing in the current release.