This project utilizes Python's turtle
module and svgpathtools
library to automatically draw an image specified in SVG format. The drawn image consists of filled areas represented by black spots.
-
Clone the repository to your local machine:
git clone https://github.com/aditya2922/automatic-picture-drawing.git
-
Replace the existing SVG file (test.svg) in the project directory with your own SVG image.
-
Run the draw_picture.py script:
python draw_picture.py
-
The turtle graphics window will open, and the image will be drawn with black-filled areas.
-
Scale: You can adjust the
scale
parameter in thesih
class to control the size of the drawn image. -
Offsets: Modify the
x_offset
andy_offset
parameters to adjust the position of the drawn image. -
Retaining the Drawing Window: By default, the drawing window closes after completing the drawing. If you want to keep the window open, set the
retain
parameter toTrue
in thedraw
method call.
pen = draw_picture('path/to/your/image.svg', scale=80)
pen.draw()
Feel free to explore and experiment with different SVG images to create unique drawings!
turtle
cv2
svgpathtools
tqdm
Contributions are welcome! If you have suggestions, find any issues, or want to enhance the project, feel free to submit pull requests or open issues.
##License
This project is licensed under the MIT License.