Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Canvas alternative for use outside Pythonista?
-
I’m using Pythonista’s built-in canvas library to draw 2D vector images for a script of mine, but would now like to run my script on a Raspberry Pi or microcontroller. Since canvas is Pythonista-only, I’m wondering if anyone knows how to either export the canvas library for use on other devices, or knows of a good alternative. I already tried Pillow, but since it’s not vector-based, the images it produces do not look as good as what canvas produces.
I mostly just need the ability to draw lines, shapes, and text, and then save the produced image as a png.
-
@zacbir made a canvas type module that was cross platform
https://github.com/zacbir/geometriq
Examples are here (though looks like he later renamed geometer to geometriq, you you might need to change the imports)
https://github.com/zacbir/geometer_scripts
I believe this worked with pythonista, MacOS Cairo, maybe pillow and a few others. You'll have to look at what backends you have available on your platform. I think he has some minimal support for svg, but not sure.
If you are looking for other non-python libraries, p5js is easy to learn, and is what the Khan Academy JavaScript course is based on
https://www.khanacademy.org/computing/computer-programming/programmingThis is a similar canvas type idea, geared towards animation. You can use the Khan framework for creating your own projects from scratch (you don't have to just do the lessons)
-
This post is deleted! -
This post is deleted!