A small tool to analyse and extract thumbnails rendered into GCODE files
Project description
gcode-thumbnail-tool
A small tool to analyse and extract thumbnails rendered into GCODE files.
Installation
pip install gcode-thumbnail-tool
Usage
As a Python library
import gcode_thumbnail_tool as gtt
path = "/path/to/a/file.gcode"
thumbnails = gtt.extract_thumbnails_from_gcode_file(path)
if result:
print(
f'Found {len(result.images)} thumbnails in {args.path}, in format "{result.extractor}":'
)
for image in result.images:
print(f"\t{image.format} @ {image.width}x{image.height}")
else:
print(f"Didn't find any thumbnails in {args.path}")
See gcode_thumbnail_tool.py:main and tests/test_api.py for more usage examples.
As a command line tool
$ gcode-thumbnail-tool
usage: gcode-thumbnail-tool [-h] [--verbose] {extract,analyse} ...
A small CLI tool to extract thumbnail images from GCODE files.
positional arguments:
{extract,analyse}
extract extracts thumbnails from the provided file as PNGs
analyse provides information on the GCODE file's thumbnails
options:
-h, --help show this help message and exit
--verbose, -v increase logging verbosity
extract
$ gcode-thumbnail-tool extract --help
usage: gcode-thumbnail-tool extract [-h] [-o OUTPUT] path
positional arguments:
path path to the GCODE file
options:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
output path for the extracted thumbnails
analyse
$ gcode-thumbnail-tool analyse --help
usage: gcode-thumbnail-tool analyse [-h] path
positional arguments:
path path to the GCODE file
options:
-h, --help show this help message and exit
Example
$ gcode-thumbnail-tool analyse tests/_files/prusa_2.9.3.gcode
Found 4 thumbnails in tests/_files/prusa_2.9.3.gcode, in format "generic":
PNG @ 16x16
PNG @ 220x124
QOI @ 64x64
JPEG @ 64x64
Acknowledgements
gcode-thumbnail-tool is based on the Slicer Thumbnails OctoPrint Plugin by jneilliii.
Big thanks to him and all the contributors!
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 gcode_thumbnail_tool-0.1.2.tar.gz.
File metadata
- Download URL: gcode_thumbnail_tool-0.1.2.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffd058eb4a369b3d08cc1d9335e88baa24f7e2c1e6692ecdabafc2f939e7779b
|
|
| MD5 |
a5da39d6c2d4309e7a4dc5f3706a7a72
|
|
| BLAKE2b-256 |
b9103f875b4160ec43fab8ad7b9f02ef1a2126c719fcc530c63130ee74ec1246
|
Provenance
The following attestation bundles were made for gcode_thumbnail_tool-0.1.2.tar.gz:
Publisher:
ci.yml on OctoPrint/gcode-thumbnail-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcode_thumbnail_tool-0.1.2.tar.gz -
Subject digest:
ffd058eb4a369b3d08cc1d9335e88baa24f7e2c1e6692ecdabafc2f939e7779b - Sigstore transparency entry: 669792063
- Sigstore integration time:
-
Permalink:
OctoPrint/gcode-thumbnail-tool@ca67ddaf76efd7fb6137598856a8c4efe14056d0 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/OctoPrint
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ca67ddaf76efd7fb6137598856a8c4efe14056d0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gcode_thumbnail_tool-0.1.2-py3-none-any.whl.
File metadata
- Download URL: gcode_thumbnail_tool-0.1.2-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
347693e9f258ace4ee88dcc7b571dfdf5aee4ac688203fa28a1ea3183f1fb227
|
|
| MD5 |
fa703d3435b73582f0f9daed00d5944a
|
|
| BLAKE2b-256 |
6986d2fac9e3a3089b6b3566e4eaf3f1541f826ab82c33e34b36082e29841492
|
Provenance
The following attestation bundles were made for gcode_thumbnail_tool-0.1.2-py3-none-any.whl:
Publisher:
ci.yml on OctoPrint/gcode-thumbnail-tool
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcode_thumbnail_tool-0.1.2-py3-none-any.whl -
Subject digest:
347693e9f258ace4ee88dcc7b571dfdf5aee4ac688203fa28a1ea3183f1fb227 - Sigstore transparency entry: 669792070
- Sigstore integration time:
-
Permalink:
OctoPrint/gcode-thumbnail-tool@ca67ddaf76efd7fb6137598856a8c4efe14056d0 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/OctoPrint
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ca67ddaf76efd7fb6137598856a8c4efe14056d0 -
Trigger Event:
release
-
Statement type: