Extract thumbnail images as png/jpg from .gcode files with C or Bash
- clone this repository locally on your machine
- run
make clean && sudo make install
from within the repository folder
gcode-preview -i benchy.gcode -o thumb.png
gcode-preview-bash benchy.gcode thumb.png
Quick benchmark of gcode-preview
vs gcode-preview-bash
extracting a 800x600 png image from a gcode file:
$ time gcode-preview-bash benchy.gcode thumb.png
real 0m0.014s
user 0m0.016s
sys 0m0.004s
$ time gcode-preview benchy.gcode thumb.png
real 0m0.002s
user 0m0.001s
sys 0m0.000s
With image previews enabled in ranger or lf, it is possible to extend the functionality to get previews for .gcode files, here is an example with lf: