import_svg
Convert SVG markup into editable, hand-drawn Excalidraw elements on a scene, turning paths, shapes, and text into real grouped objects you can revise.
Instructions
Draw by writing SVG. THE way to draw anything that has to look like something: a character, creature, object, vehicle, logo, illustration. This is what produces good figures; stacking shapes with add_elements does not.
The result is hand-drawn, not pasted: every path becomes a real editable Excalidraw element (grouped as one piece), curves are re-spaced to hand-sized strokes and drawn with the sketchy pen, // become native shapes. Write the SVG for SHAPE, PROPORTION and COLOUR and let the canvas supply the pen - do not fake wobble or hatching in the SVG.
A recipe that works for a figure:
viewBox about 300 x 600 for a standing figure; import at width 350-450.
ONE closed path per body region - torso, each leg, each arm - tapered like a real limb (forearm ~60% of the upper arm, calf into a narrow ankle), plus head, hands, feet. Let them overlap; later paths draw on top. Then detail as separate strokes OVER the silhouette: plates, seams, webbing, a knee line. A few, not many.
Every shape: fill=<vibrant, character-accurate hex> stroke=<the scene ink from describe_scene, or a deep shade of the fill> stroke-width 2 to 2.5. Filled shapes with no stroke read as flat.
Flat colour, no shading. One solid fill per part; a darker part is a darker hex, not a hatched overlay or a shadow shape. The sketchy outline carries the drawing - texture on top of it looks overworked.
Proportion from a rule: 7-8 heads tall for heroic, 5-6 for stylised. Head first, derive the rest.
Then render_scene and LOOK; fix what is off. The first pass is usually mis-proportioned, the second is right.
Supported: path (all commands), rect, circle, ellipse, line, polyline, polygon, g, transform, /class, /, presentation attributes, text. viewBox honoured exactly. Gradients flatten to their first stop; pass holeColor to punch compound-path holes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Where to place it on the canvas. Default 0. | |
| y | No | Default 0. | |
| svg | Yes | Complete SVG markup, including the <svg> element and its viewBox. | |
| step | No | Anchor spacing for curves in sketch mode, in canvas px. Default 18. Lower keeps more of the source curve; higher is looser. | |
| group | No | Group the result as one unit. Default true. | |
| label | Yes | Short description of what this change is doing, e.g. 'add the dog illustration'. Shown next to the snapshot in the history sidebar, which is how the user decides whether to keep or revert it. Always set it. | |
| scene | Yes | Scene id, exact name, or a unique part of the name. Use list_scenes if unsure. | |
| style | No | sketch (default): hand-drawn treatment - anchors re-spaced, curves as curves, roughness 1, native circles/rects. precise: every flattened vertex kept, roughness 0 - for a logo or a drawing that must be exact. | |
| width | No | Scale the artwork to this width, keeping its aspect ratio. Height follows. | |
| height | No | Optional bound on height. | |
| fillStyle | No | Fill for every filled shape. Default solid. hachure for a lighter, sketchier piece (small shapes stay solid); cross-hatch for weight. | |
| holeColor | No | Backdrop colour used to punch compound-path holes. | |
| roughness | No | 0 precise, 1 sketchy (default in sketch mode), 2 very sketchy. | |
| tolerance | No | Curve flattening, in source units. Default 3. Lower is smoother and heavier. |