Menu

Tree [0f984d] master /
 History

HTTPS access


File Date Author Commit
 test 2025-04-22 Martin D. Adamiker Martin D. Adamiker [0f984d] Added test directory
 .gitignore 2025-04-22 Martin D. Adamiker Martin D. Adamiker [0f984d] Added test directory
 CMakeLists.txt 2025-04-16 Martin D. Adamiker Martin D. Adamiker [77e88b] Improved class Walker: integer operations only....
 README.md 2025-04-11 Martin D. Adamiker Martin D. Adamiker [b65efd] Initial commit
 image2relief.cpp 2025-04-22 Martin D. Adamiker Martin D. Adamiker [7670a4] Scan both across and down
 walker.cpp 2025-04-22 Martin D. Adamiker Martin D. Adamiker [7670a4] Scan both across and down
 walker.h 2025-04-22 Martin D. Adamiker Martin D. Adamiker [7670a4] Scan both across and down

Read Me

image2relief

image2relief is a C++ program using OpenCV to convert raster images into G-code for CNC engraving. It is particularly suited for engraving gemstones and creating mid-reliefs, low reliefs, or shallow-reliefs (without undercuts).

Features

  • Converts grayscale images into G-code for CNC machines.
  • Efficiently simulates end mill footprints using circular max filters.
  • Outputs minimal G-code by detecting only significant depth changes.
  • Supports various tool diameters and multi-pass refining.
  • Modular and open-source design using C++ and OpenCV.

How it works

  1. Load a raster image.
  2. Define a scanning path (currently raster path; spiral and zigzag planned).
  3. For each scan point:
    • Sample the image in a circular area of radius R (half the tool diameter).
    • Find the maximum pixel value in the area.
    • If the value differs from the last, emit G-code for tool movement.
  4. The result is an efficient G-code file for relief engraving.

Example

image2relief input.png --tool-radius 1.0 --step 0.5 > output.gcode

Requirements

  • C++14 or newer
  • OpenCV 4.x
  • A G-code compatible CNC machine

License

This project is licensed under a license to be defined (e.g., MIT, GPL).

Contributions

Contributions, bug reports, and feature suggestions are welcome via SourceForge project page.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.