Skip to content

Conversation

@ellensp
Copy link
Contributor

@ellensp ellensp commented Nov 23, 2025

Description

Initial rough draft of adding gcode preview to TFT_COLOR_UI.

Only been tested in the SIM (See example Config below)

New Configuration_adv.h options

//#define HAS_GCODE_PREVIEW 1 // Preview G-code model thumbnail
//#define HAS_JPEG_DECODER 1 // Enable JPEG thumbnail decoding
//#define HAS_PNG_DECODER 1 // Enable PNG thumbnail decoding
//#define HAS_QOI_DECODER 1 // Enable QOI thumbnail decoding

I have only implemented basic functionality. decoding and displaying of the preview
All resolution screens need cleaned up and made pretty.

Very much a work in progress.

eg

Screenshot from 2025-11-23 10-52-14

Requirements

TFT_COLOR_UI and SDSUPPORT

Example Config files

Sim example Configuration.zip

Benefits

Gives the user a visual display of the gcode preview file in the gcode they have selected.

Related Issues

  • [FR] MarlinUI - Gcode preview #23726
  • @thisiskeithb thisiskeithb linked an issue Nov 23, 2025 that may be closed by this pull request
    @thinkyhead thinkyhead force-pushed the gcode-preview-colour-ui branch from ee90bdc to bde33cd Compare December 2, 2025 22:57
    @thinkyhead thinkyhead force-pushed the gcode-preview-colour-ui branch from 13bc612 to fb27eb9 Compare December 2, 2025 23:40
    @thinkyhead
    Copy link
    Member

    Looks cool, and overall everything is clean and styled. We can put third party headings on any contributed files, like the decoders, with a smaller Marlin "This file is part of..." heading instead of the whole GPL precursor. In general, such a lesser header could be placed on all minimally-modified library files to emphasize their own (often more open) licenses.


    The image reminds me that we need to fix up that "remaining time" estimate. It's been bugging me. The remaining time estimate starts early in the print before calibration and heating, but it should wait for the first printing move and subtract all the previous time and the SD Position for the rest of the estimate. This will make the estimation that uses the file position a little bit closer to true, and get rid of the useless estimation before the print gets started. Other heuristic adjustments can be made, but of course letting the slicer provide the remaining time estimate will always be best.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    [FR] MarlinUI - Gcode preview

    2 participants