avendika/cnc-batik-sketch
0
๐จ 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
- Upload an image - Click on the upload area and select your image
- Adjust parameters (optional) - Fine-tune the edge detection settings
- Generate G-code - Click the "Generate G-code" button
- Download - Download the generated G-code file
- 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
