A small widget to let users draw by hand in a Jupyter notebook.
Project description
Jupyter drawing utility
Small utility to make simple drawings in Jupyter notebooks with ipycanvas and ipywidgets. Useful for getting quick user input in research prototypes, e.g., for masking or annotation.
Install
pip install ipycanvas-drawing
Usage
Create a simple drawing interface. Check out the notebook in examples for a more complete example.
from ipycanvas_drawing import DrawingWidget
# Create a drawing widget
# You can set other setup parameters: background, alpha, default_style, default_radius
drawing_widget = DrawingWidget(width=500, height=500)
# Show the drawing widget
drawing_widget.show()
# Get the image data as a numpy array
image_output = drawing_widget.get_image_data()
Known issues
- Visual Studio Code's Jupyter environment doesn't like ipycanvas's
sync_image_datafunctionality. Workaround: open notebooks in Jupyter lab or Notebook in the browser. - ipycanvas does not work in Google Colab. Workaround: use the Binder to quickly try the tool without needing to install it on your own machine.
Credits
Based on the hand drawing example provided by @martinRenou, but adds some additional functionality like adding squares and ellipses and a 1-step undo.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ipycanvas_drawing-0.0.5.tar.gz.
File metadata
- Download URL: ipycanvas_drawing-0.0.5.tar.gz
- Upload date:
- Size: 47.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
622f145bcee54c7e50f970cba7e63da6b2a42f63eafc9ab6585aa63af90aca22
|
|
| MD5 |
0c85c0e7e9038d5152837cf7f568a692
|
|
| BLAKE2b-256 |
e54404ce64598f63945f5b180d71e21a38e677fb2987db263b2c04227c383c21
|
File details
Details for the file ipycanvas_drawing-0.0.5-py3-none-any.whl.
File metadata
- Download URL: ipycanvas_drawing-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43ed59c3cc2946d9846fe86b3470ee03e6d1460fdeee9d277783dc324b6824bf
|
|
| MD5 |
802be3064cceb37187d85ff2dd17c0d9
|
|
| BLAKE2b-256 |
71773e28e0e3d8f2f6fb50c5c901feebabd101265397bacf1788a9d65e58629e
|