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.3.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.3-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gcode_thumbnail_tool-0.1.3.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gcode_thumbnail_tool-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ec7c0e2a36797abb1ebfa4514c0044aff6d723828b5d90be067bac3a4dc8466c
MD5 5e6ac824268a02f21e4003b5bf947dde
BLAKE2b-256 0a7ee8d3b837d2d41018a4414e9aab70f1c686a1552043122468854618a1006d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gcode_thumbnail_tool-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 36f8370419ec99641da99a71a850d52a4b8b9f8705d550469371651dc2a87255
MD5 60a0b1d8ac126db67eb5ac5b24cecfb6
BLAKE2b-256 f5cde716d5197596fdaccb80fca59f99d91dfd788007c792769c17a8e40177f8

See more details on using hashes here.

Provenance

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