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
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 G_Sketch-0.1.2-py3-none-any.whl.
File metadata
- Download URL: G_Sketch-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d339a88ab8af3c130e67e19b0ef4f89f369141af75a1edc7d65f8313714489c5
|
|
| MD5 |
9856f35f285e24b26e3c80c160c3e548
|
|
| BLAKE2b-256 |
6bacff60b84fd8893b5e58f378b3a885795347740c36eb146a48cf0adf723703
|