Skip to main content

Converts image files to coordinates

Project description

Thank you for using this library! Here are the basic ways to use it:

Please report any bugs to gerald.j.negvesky@gmail.com

To import, do:

from G_Sketch import *

To create an object do:

my_sketch = Sketch("path/to/file.png")

There are 3 functions for a sketch:

  • get_coords()
  • get_raw_coords()
  • set_min_distance()

get_coords()

This function returns a list of coordinates (stored as tuples). This version is formatted, meaning between separate bodies, there appears the keyword "BREAK", which can help prevent crossing over.

get_raw_coords()

This function is exactly the same, except it does not include the keyword "BREAK".

set_min_distance()

get_coords() and get_min_coords() return every single pixel found on the outline of an image. If you want to limit these, use this function. It takes in an int as a parameter which sets the minimum distance 2 pixels must be from each other. Note: this changes the pixels value stored in it. Calling set_min_distance(1) will change it back to normal.

Example code:

from G_Sketch import *

sketch = Sketch("G_Sketch/flower.png")

print(sketch.get_coords())

print(sketch.get_raw_coords())

print(len(sketch.get_coords()))

sketch.set_min_distance(5)

print(len(sketch.get_coords()))

Happy coding!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

G_Sketch-0.1.4-py3-none-any.whl (50.4 kB view details)

Uploaded Python 3

File details

Details for the file G_Sketch-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: G_Sketch-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 50.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.0

File hashes

Hashes for G_Sketch-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 36e28a78043f643c603b4bb575b3ec8c4c189fc9c6370f936973feceb77c1d28
MD5 f82deacc76a5a018ec5082b6c6a6b723
BLAKE2b-256 55667581c627c4d9ff2b0626812e10a1b3af05fa350c1285d30203bd99620ec0

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