CoolFace
Apppublic

avendika/cnc-batik-sketch

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
App README

๐ŸŽจ CNC Batik Sketch Generator

Convert your images to G-code for CNC drawing machines!

Features

  • โ€”๐Ÿ“ธ Upload any image (JPG, PNG, etc.)
  • โ€”๐Ÿ”ง Adjustable edge detection parameters
  • โ€”๐Ÿ“ Auto-scaled to A4 size (297mm x 210mm)
  • โ€”๐Ÿ“ฅ Download G-code file ready for CNC machines
  • โ€”โšก Real-time edge detection preview

How to Use

  1. 1.Upload an image - Click on the upload area and select your image
  2. 2.Adjust parameters (optional) - Fine-tune the edge detection settings
  3. 3.Generate G-code - Click the "Generate G-code" button
  4. 4.Download - Download the generated G-code file
  5. 5.Use with CNC - Load the G-code into your CNC machine

Parameters Explained

  • โ€”Blur Kernel: Smoothing level before edge detection (higher = smoother)
  • โ€”Canny Low/High Threshold: Edge detection sensitivity
  • โ€”Feed Rate: Speed of CNC movement (mm/min)
  • โ€”Pen Up/Down Position: Z-axis positions for pen control

Technology Stack

  • โ€”OpenCV: Image processing and edge detection
  • โ€”NumPy: Numerical computations
  • โ€”Gradio: User interface
  • โ€”Python: Backend processing

Output Format

The generated G-code is compatible with standard CNC machines and includes:

  • โ€”G21 (metric units)
  • โ€”G90 (absolute positioning)
  • โ€”Optimized contour paths
  • โ€”Pen up/down commands

Perfect For

  • โ€”Batik pattern creation
  • โ€”Sketch drawing
  • โ€”Line art reproduction
  • โ€”CNC plotter projects

Made with โค๏ธ for CNC enthusiasts