Skip to main content

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


Download files

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

Source Distribution

gcode_thumbnail_tool-0.1.2.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

gcode_thumbnail_tool-0.1.2-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

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

Hashes for gcode_thumbnail_tool-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ffd058eb4a369b3d08cc1d9335e88baa24f7e2c1e6692ecdabafc2f939e7779b
MD5 a5da39d6c2d4309e7a4dc5f3706a7a72
BLAKE2b-256 b9103f875b4160ec43fab8ad7b9f02ef1a2126c719fcc530c63130ee74ec1246

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcode_thumbnail_tool-0.1.2.tar.gz:

Publisher: ci.yml on OctoPrint/gcode-thumbnail-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gcode_thumbnail_tool-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gcode_thumbnail_tool-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 347693e9f258ace4ee88dcc7b571dfdf5aee4ac688203fa28a1ea3183f1fb227
MD5 fa703d3435b73582f0f9daed00d5944a
BLAKE2b-256 6986d2fac9e3a3089b6b3566e4eaf3f1541f826ab82c33e34b36082e29841492

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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