Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipycanvas-drawing

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipycanvas-drawing

A small widget to let users draw by hand in a Jupyter notebook.

  • 0.0.5
  • PyPI
  • Socket score

Maintainers
1

Jupyter drawing utility

Binder

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

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_data functionality. 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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc