Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,45 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Image to Line Art SVG Converter
|
| 2 |
+
|
| 3 |
+
A Gradio-powered web application that converts images to line art and exports them as SVG files.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- Upload images via file upload or webcam
|
| 8 |
+
- Convert images to clean line art using computer vision techniques
|
| 9 |
+
- Adjustable parameters for line thickness, blur, and threshold
|
| 10 |
+
- Export results as scalable SVG files
|
| 11 |
+
- Real-time preview of the conversion
|
| 12 |
+
|
| 13 |
+
## How it Works
|
| 14 |
+
|
| 15 |
+
1. **Image Preprocessing**: Converts the input image to grayscale
|
| 16 |
+
2. **Noise Reduction**: Applies median filtering to reduce noise
|
| 17 |
+
3. **Edge Detection**: Uses adaptive thresholding to detect edges
|
| 18 |
+
4. **Contour Extraction**: Finds and simplifies contours from the edges
|
| 19 |
+
5. **SVG Generation**: Converts contours to SVG paths for scalable output
|
| 20 |
+
|
| 21 |
+
## Usage
|
| 22 |
+
|
| 23 |
+
1. Upload an image using the upload button or webcam
|
| 24 |
+
2. Optionally adjust the parameters:
|
| 25 |
+
- **Line Thickness**: Controls the stroke width of the lines (1-5)
|
| 26 |
+
- **Blur Value**: Affects noise reduction (must be odd, 3-15)
|
| 27 |
+
- **Threshold Value**: Controls edge sensitivity (must be odd, 3-15)
|
| 28 |
+
3. Click "Convert to Line Art" to process the image
|
| 29 |
+
4. Download the generated SVG file
|
| 30 |
+
|
| 31 |
+
## Technical Details
|
| 32 |
+
|
| 33 |
+
- Built with Gradio for the web interface
|
| 34 |
+
- Uses OpenCV for image processing and edge detection
|
| 35 |
+
- Converts contours to SVG paths for vector output
|
| 36 |
+
- Optimizes SVG size by simplifying contours
|
| 37 |
+
|
| 38 |
+
## Requirements
|
| 39 |
+
|
| 40 |
+
- Python 3.8+
|
| 41 |
+
- See requirements.txt for dependencies
|
| 42 |
+
|
| 43 |
+
## License
|
| 44 |
+
|
| 45 |
+
MIT License
|