Skip to main content

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

turtle2img-1.1.5.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

turtle2img-1.1.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file turtle2img-1.1.5.tar.gz.

File metadata

  • Download URL: turtle2img-1.1.5.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.14

File hashes

Hashes for turtle2img-1.1.5.tar.gz
Algorithm Hash digest
SHA256 ba7d4a554daec6df2219367e2e840aaf7243a858ecf6e10063d17f054ed9b740
MD5 fc94bc3ccc727623a42388ae1ac40b31
BLAKE2b-256 dd4c7214b969c1da2612ff2449fe914e4806982a73c18ae90d30493f9406e48f

See more details on using hashes here.

File details

Details for the file turtle2img-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: turtle2img-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.14

File hashes

Hashes for turtle2img-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 11e472a3a0e9cf384e59d488762f3202302c19889ce49ce49a3a77fa693bcbff
MD5 5f1b859c31f31a28eb509f955e168e77
BLAKE2b-256 7628291506e8dbf6c36a6c9e35eae8f520953d5f2dabf4b0331eb067e71e5356

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page