A Python drawing library for custom shapes, rotation, and interactive editing using OpenCV.
Project description
SpectraSketch
SpectraSketch is a flexible Python drawing library built on top of OpenCV. It enables developers, students, and hobbyists to create and manipulate custom geometric shapes programmatically with ease. It also supports undo/redo functionality, shape rotation, filled or outlined styles, and batch drawing operations.
Features
- Draw a variety of shapes - lines, rectangles, circles, triangles, diamonds, polygons, stars, hearts and more
- Rotate shapes with precise angle control
- Undo/Redo support for safe experimentation
- Customisable canvas size and background color
- Batch mode for grouped drawing operations
- Input validation to prevent drawing errors
- Save your canvas as an image (PNG,JPG etc.)
- Simple API that integrates easily into other python projects
Installation
pip install spectrasketch
Quick Example
from spectrasketch import ShapeLab
lab = ShapeLab(width=800, height=600, background_color=(255, 255, 255))
lab.line((50, 50), (200, 50), (255, 0, 0), 2)
lab.rectangle((100, 100), (250, 200), 45, (0, 255, 0), 3)
lab.circle((400, 300), 50, (0, 0, 255), -1)
lab.launch_viewer()
Why SpectraSketch?
- Fast prototyping for Computer Vision projects
- Create educational visualisations for geometry or graphics
- Develop custom image annotation tools
- Easily extend for your own shapes and logic
License
Licensed under the Apache License, Version 2.0
Project details
Release history Release notifications | RSS feed
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 spectrasketch-0.1.3.tar.gz.
File metadata
- Download URL: spectrasketch-0.1.3.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03f51b9dc7bfdce307687d3e6c083639a3fd8810b819643191e675e149379aec
|
|
| MD5 |
7dd090b3b59ec63d575ae96c321e61e3
|
|
| BLAKE2b-256 |
3094a5e95071ef1951ef7f0f56acc502f9fef407b626ba26196e07bdc3b5541c
|
File details
Details for the file spectrasketch-0.1.3-py3-none-any.whl.
File metadata
- Download URL: spectrasketch-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6c9db497e0087255deb32fb1ad1c5c25b9b08a0cc87a5ffbfd2f37ba0da5341
|
|
| MD5 |
6a15b2cd7cbf090726e39d30507cf13a
|
|
| BLAKE2b-256 |
0c6ab8e00e76e231849ef987a4c432792f7cdf0bf7eab867305b6c0db999d38f
|