Tear open drawing canvases inside Jupyter code. In Python, read the canvases as NumPy image data.
OTHER License
Use Ctrl+\ (Backslash) to inject a canvas at the cursor position in the selected cell. Draw on it:
In-line, canvases act as variable names. On running the cell, silently injected code sets the variables equal to NumPy image data. (This performs a number of imports: base64, numpy as np, io.BytesIO, and PIL.Image. If you pass the image as a single argument to a function (e.g. foo(canvas)) it will also pass the locals() dict as an added '.locals' attribute of the nparray object.)
Pass handwritten digits to an MNIST recognizer for all I care! Here's an example of a magical QCR function recognizing a handwritten quantum circuit (function not included):
And here's an obligatory MNIST example (see examples/ folder for more):
Relatedly, ensure your namespace doesn't use names Image, BytesIO, or base64 except where imported from the PIL, io, and base64 libraries. Note that I cannot guarantee compatibility with other extensions.