Save turtle images as jpg or png
Project description
This is a fork of WojciechMula/canvas2svg which uses svglib, reportlab and Pillow to convert things drawn in Python’s turtle library to png or jpg files.
The list of supported items is the same as canvas2svg.
Supported items:
lines
lines with arrows
polygons
smoothed lines and polygons
ovals (i.e. circle & ellipse)
arcs (all kind, i.e. ARC, CHORD, PIESLICE)
rectangles
text (unwrapped only i.e. attribute width = 0)
Unsupported items:
images
bitmaps
windows
Stipples are not applied.
Public functions
save_png(filepath: str, margin=10) -> None:
filepath: The filepath to save the output image to
margin: The number of pixels around the bounding box of image elements to include
save_jpg(filepath: str, margin=10) -> None:
filepath: The filepath to save the output image to
margin: The number of pixels around the bounding box of image elements to include
Original repository: https://github.com/WojciechMula/canvas2svg
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
Hashes for turtle2img-1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da06bb292f53082e8a823081ba9b6a6446331031ac2cf8a27868cfb335195ef2 |
|
MD5 | 9a8811906b1d3eb91db2efd0e126603c |
|
BLAKE2b-256 | 0793874f9b2166388e03f926a1997e0d620edaa9821be7fba87a6005f405262c |