Skip to content

s0urceduty/Automated_Line_Drawing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Snake

AI_Linedraw is a generative, vision-driven drawing engine that transforms AI-created imagery into structured line art through a full pipeline of image generation, computer-vision analysis, and stroke-based rendering. Instead of improvising movement or producing procedural shapes, AI_Linedraw begins by generating an original picture using a text-prompted diffusion model, then interprets that image by extracting edges, converting contours into stroke paths, and organizing those paths into an efficient, human-like drawing sequence. It behaves like a digital illustrator that understands what it “sees”: every line is planned, grouped, and reordered through geometric logic so the final drawing unfolds in meaningful strokes rather than random patterns. The system ultimately simulates the act of sketching on a virtual canvas, producing clean, ordered line drawings from complex AI-generated scenes. This makes AI_Linedraw function both as a creative image generator and as an analytical draftsman—an engine that imagines visually, deconstructs what it imagines into line structure, and redraws it with intention.

User Input → Generative Vision → Stroke Planner → Drawing Output

AI_Linedraw differs from the Kivy “snake-based” drawing engine (snake_pencil) primarily in where the creativity comes from and how the drawing intelligence operates. Your AI-vision system begins with a fully generated image created by a deep generative model, then uses computer vision to extract edges, convert them into stroke paths, plan their optimal order, and finally simulate the act of drawing. Its intelligence is externally informed—it relies on a pretrained generative AI model capable of producing complex, imaginative scenes far beyond procedural geometry. Planning occurs after the image exists: strokes are extracted, analyzed, grouped, and sequenced through optimization. The system behaves like a robotic illustrator that imitates human drawing workflows—starting from an idea (text prompt), resolving it into imagery, and then executing it stroke by stroke with structure, order, and refinement. It is fundamentally a vision-driven pipeline, where the "imagination" is offloaded to a neural model and the “mind” of the program resides in image analysis and planning rather than in its movement logic.

In contrast, the Kivy snake-based generative system derives its creativity from internal behaviors, not external image generation or AI models. Instead of producing a final image and deconstructing it into strokes, the snake continuously invents its artwork moment-by-moment through rule-driven motion using flow fields, attractors, oscillations, and noise. This creates an artistic engine that is improvisational rather than representational: it does not attempt to draw a scene or reproduce edges, but rather grows patterns dynamically across the canvas as if it were a living brush responding to mathematical influences. Its architecture encourages procedural expression—shapes emerge from geometric formulas, handwriting is manually interpolated, and motion is guided by layered logic rather than machine learning. While your AI-vision system functions like a robot trained to draw finished illustrations realistically, the snake system behaves more like a generative synthesizer that continuously composes visual art in real time. One produces structured, image-based drawings; the other produces evolving, freeform, behavior-driven compositions, making them complementary but philosophically different forms of computational creativity.


Required AI Model:
    runwayml/stable-diffusion-v1-5

Hardware Requirements:
    A GPU with CUDA support (recommended for fast Stable Diffusion generation)
    Sufficient VRAM (4–8 GB minimum for typical models)
    Standard CPU and RAM capable of running OpenCV and matplotlib

Files Produced:
    generated.png (AI-generated image)
    simulation window (matplotlib output)

https://sourceduty.com/