Metadata-Version: 2.1
Name: ipycanvas_drawing
Version: 0.0.5
Summary: A small widget to let users draw by hand in a Jupyter notebook.
Project-URL: Homepage, https://github.com/rubenwiersma/ipycanvas_drawing
Project-URL: Bug Tracker, https://github.com/rubenwiersma/ipycanvas_drawing/issues
Author-email: Ruben Wiersma <rubenwiersma@gmail.com>
License-File: LICENSE
Requires-Python: >3.6
Requires-Dist: ipycanvas
Requires-Dist: ipywidgets
Requires-Dist: numpy
Description-Content-Type: text/markdown

# Jupyter drawing utility
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/rubenwiersma/ipycanvas_drawing/HEAD?labpath=examples%2Fexample_drawing.ipynb)

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.

![Example usage](img/example_screenshot.png)


## Install
```bash
pip install ipycanvas-drawing
```

## Usage
Create a simple drawing interface. Check out the notebook in `examples` for a more complete example.

```python
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_data` functionality.
  Workaround: open notebooks in Jupyter lab or Notebook in the browser.
- ipycanvas does not work in Google Colab.
  Workaround: use the [Binder](https://mybinder.org/v2/gh/rubenwiersma/ipycanvas_drawing/HEAD?labpath=examples%2Fexample_drawing.ipynb) to quickly try the tool without needing to install it on your own machine.

## Credits
Based on the [hand drawing example](https://github.com/martinRenou/ipycanvas/blob/master/examples/hand_drawing.ipynb) provided by @martinRenou, but adds some additional functionality like adding squares and ellipses and a 1-step undo.
