make detailed butterfly svg
- User
make detailed butterfly svg
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
make detailed butterfly svg
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Okay, here is a detailed SVG code for a butterfly. This example aims for a balance between detail and code readability. It includes:
<g> groups and the <use> element with a transform to create perfect symmetry for the wings and antennae.C command in paths) for smooth, organic wing shapes.<svg width="200" height="200" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<!-- Define a radial gradient for wing color -->
<radialGradient id="wingGradient" cx="50%" cy="50%" r="70%" fx="60%" fy="60%">
<stop offset="0%" style="stop-color:#FFD700; stop-opacity:1" /> <!-- Bright Yellow center -->
<stop offset="60%" style="stop-color:#FFA500; stop-opacity:0.95" /> <!-- Orange mid -->
<stop offset="100%" style="stop-color:#D2691E; stop-opacity:0.9" /> <!-- Chocolate edge -->
</radialGradient>
<!-- Define a darker gradient for hind wings -->
<radialGradient id="hindWingGradient" cx="50%" cy="80%" r="60%" fx="50%" fy="75%">
<stop offset="0%" style="stop-color:#FFA500; stop-opacity:1" /> <!-- Orange center -->
<stop offset="50%" style="stop-color:#D2691E; stop-opacity:0.95" /> <!-- Chocolate mid -->
<stop offset="100%" style="stop-color:#8B4513; stop-opacity:0.9" /> <!-- SaddleBrown edge -->
</radialGradient>
</defs>
<!-- Butterfly Body -->
<path id="body" d="M 50 15
Q 47 30, 47 50
T 48 75
Q 50 90, 52 75
T 53 50
Q 53 30, 50 15 Z"
fill="#4B3621" <!-- Dark Brown -->
stroke="#2F1E0E" stroke-width="0.5"/>
<!-- Define Left Side Components -->
<g id="left-side">
<!-- Left Antenna -->
<g id="left-antenna">
<path d="M 50 18 Q 40 8, 35 10"
stroke="#2F1E0E" stroke-width="0.8" fill="none" stroke-linecap="round"/>
<circle cx="35" cy="10" r="1.2" fill="#2F1E0E"/>
</g>
<!-- Left Wing Set -->
<g id="left-wing-set">
<!-- Left Hindwing (drawn first to be underneath forewing near body) -->
<path id="left-hindwing-shape"
d="M 50 55
C 30 65, 10 80, 15 95
C 25 98, 40 90, 50 80 Z"
fill="url(#hindWingGradient)" stroke="#654321" stroke-width="0.3"/>
<!-- Left Hindwing Veins & Patterns -->
<g id="left-hindwing-details">
<path d="M 50 60 Q 30 75, 18 90" stroke="#4B3621" stroke-width="0.4" fill="none"/>
<path d="M 50 70 Q 35 85, 30 92" stroke="#4B3621" stroke-width="0.4" fill="none"/>
<circle cx="25" cy="85" r="3" fill="#FFFAF0" opacity="0.8"/> <!-- Floral White spot -->
<circle cx="35" cy="88" r="2" fill="#FFFAF0" opacity="0.8"/>
</g>
<!-- Left Forewing -->
<path id="left-forewing-shape"
d="M 50 25
C 20 10, 0 30, 10 60
C 15 80, 35 85, 50 70 Z"
fill="url(#wingGradient)" stroke="#8B4513" stroke-width="0.5"/>
<!-- Left Forewing Veins & Patterns -->
<g id="left-forewing-details">
<!-- Veins -->
<path d="M 50 30 Q 25 25, 5 40" stroke="#654321" stroke-width="0.5" fill="none"/>
<path d="M 50 45 Q 20 45, 8 55" stroke="#654321" stroke-width="0.5" fill="none"/>
<path d="M 50 60 Q 30 65, 15 70" stroke="#654321" stroke-width="0.5" fill="none"/>
<!-- Spots/Patterns -->
<circle cx="15" cy="28" r="3.5" fill="#1E1E1E" opacity="0.7"/> <!-- Dark spot near top edge -->
<circle cx="10" cy="45" r="5" fill="#FFFAF0" opacity="0.9"/> <!-- Floral White spot middle -->
<circle cx="11" cy="46" r="2.5" fill="#1E1E1E" opacity="0.7"/> <!-- Inner dark spot -->
<circle cx="25" cy="65" r="3" fill="#1E1E1E" opacity="0.7"/> <!-- Dark spot near bottom edge -->
</g>
</g>
</g>
<!-- Create Right Side using the Left Side definition -->
<!-- The transform mirrors the left side across the Y-axis (x=50) -->
<use xlink:href="#left-side" transform="translate(100, 0) scale(-1, 1)"/>
</svg>
How to Use:
butterfly.svg.<img> tag or directly within the HTML:
<img src="butterfly.svg" alt="Detailed Butterfly" width="200"><svg>...</svg> block into your HTML body.Explanation of Key Parts:
<svg ...>: The main SVG container. viewBox="0 0 100 100" sets up a 100x100 coordinate system, making positioning easier.<defs>: Defines elements that can be reused, like the radialGradients used for the wing fills.<radialGradient>: Creates smooth color transitions radiating from a central point (cx, cy, fx, fy) with color stops (<stop>).<path id="body" ...>: Draws the central body using quadratic (Q) and smooth quadratic (T) Bézier curves. Z closes the path.<g id="left-side">: Groups all elements belonging to the left half of the butterfly. This makes it easy to duplicate and mirror.<g id="left-antenna">: Contains the path for the antenna stalk and a circle for the club. stroke-linecap="round" makes the path end look nicer.<g id="left-wing-set">: Groups the hindwing and forewing together.<path id="left-hindwing-shape" ...> and <path id="left-forewing-shape" ...>: Define the main wing shapes using cubic Bézier curves (C). They are filled using the url(#gradientID) syntax.<g id="left-hindwing-details"> and <g id="left-forewing-details">: Contain paths for veins (stroke, fill="none") and circles (<circle>) or other shapes for patterns/spots. These are drawn after the main wing shapes within their group, so they appear on top.<use xlink:href="#left-side" transform="translate(100, 0) scale(-1, 1)"/>: This is the magic for symmetry.
xlink:href="#left-side": References the group containing all the left-side elements.transform="...": Applies transformations:
scale(-1, 1): Flips the referenced group horizontally (multiplies all x-coordinates by -1).translate(100, 0): Shifts the flipped group 100 units to the right. Because the original coordinates were based around x=50 being the center, flipping around x=0 and then shifting right by 100 effectively mirrors the left side (0 to 50) onto the right side (100 to 50).This structure makes it relatively easy to modify colors, patterns, or even the wing shapes by just editing the elements within the <g id="left-side"> definition, and the changes will automatically apply to both sides.