ipysketch_lite package#

Module contents#

class ipysketch_lite.AnnotationSketch(base_image: PIL.Image.Image)#

Bases: BaseSketchWidget

AnnotationSketch class to create a sketch instance with a base image This includes a template that allows for basic drawing utilities The base image is drawn on the canvas and can be annotated

data_url#

A trait for unicode strings.

get_template() → str#

Return the subclass’s JavaScript drawing template.

class ipysketch_lite.BaseSketchWidget(width: int = 400, height: int = 300)#

Bases: AnyWidget

Abstract base for widget setup, image synchronization, and saving. Subclasses provide their drawing frontend through get_template.

property data: str#

Get the sketch image data as a base64 encoded string

abstractmethod get_template() → str#

Return the subclass’s JavaScript drawing template.

property image: Image#

Get the sketch image data as a PIL image

class ipysketch_lite.RasterSketch(width: int = 400, height: int = 300)#

Bases: BaseSketchWidget

Canvas-based sketch widget storing raster image data.

get_template() → str#

Return the subclass’s JavaScript drawing template.

class ipysketch_lite.Sketch(width: int = 400, height: int = 300)#

Bases: BaseSketchWidget

Default sketch widget with vector strokes, bucket fill, and adjustable line width. This includes a template that allows for basic vector drawing utilities Sketch image data is stored as a base64 encoded string, and SVG data is also available

get_template() → str#

Get the template JavaScript for the vector sketch widget

property svg: str#

Get the sketch SVG data as a string