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.1.tar.gz (20.0 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.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file gcode_thumbnail_tool-0.1.1.tar.gz.

File metadata

  • Download URL: gcode_thumbnail_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 20.0 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.1.tar.gz
Algorithm Hash digest
SHA256 d77ee8b4ddc5dd840e04796325ec18e2f98fda2eb32143ecc3b16640abe05875
MD5 a19974314967decf7f5fd86c3111015e
BLAKE2b-256 5945871ab62cdeaefe7d164b62a60d0f87f0ed71a9fa8f66646370625c3768a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcode_thumbnail_tool-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gcode_thumbnail_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32ce980a7bac991c744a5811a9c6bb70d5858306e25a131427247cc426311e6a
MD5 ebe201fed90a185beb2397bc4b69b6d8
BLAKE2b-256 1357b953175567ea9c6ae0d8bfb81c172becccd459b63347d42a784477f4cf80

See more details on using hashes here.

Provenance

The following attestation bundles were made for gcode_thumbnail_tool-0.1.1-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