grok-3-preview-02-24· xAI
LMArena Human Preference 140K
write detailed svg code for butterfly
- User
write detailed svg code for butterfly
- Assistant
Below is a detailed SVG code for a butterfly illustration. This design includes symmetrical wings with gradient fills, patterns, and a simple body. The butterfly is colorful and stylized, with a focus on symmetry and aesthetics.
<svg width="400" height="300" viewBox="0 0 400 300" xmlns="http://www.w3.org/2000/svg"> <!-- Background (optional) --> <rect width="400" height="300" fill="#e6f3ff"/> <!-- Definitions for gradients and patterns --> <defs> <!-- Gradient for upper wings --> <linearGradient id="upperWingGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#ff6f61;stop-opacity:1"/> <stop offset="100%" style="stop-color:#ffcc5c;stop-opacity:1"/> </linearGradient> <!-- Gradient for lower wings --> <linearGradient id="lowerWingGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#88d8b0;stop-opacity:1"/> <stop offset="100%" style="stop-color:#6bffcc;stop-opacity:1"/> </linearGradient> <!-- Pattern for wing spots --> <pattern id="spotPattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"> <circle cx="10" cy="10" r="5" fill="#ffffff" opacity="0.8"/> </pattern> </defs> <!-- Butterfly Body --> <g transform="translate(200, 150)"> <!-- Body --> <rect x="-10" y="-80" width="20" height="160" rx="10" fill="#4a4a4a"/> <!-- Head --> <circle cx="0" cy="-90" r="15" fill="#4a4a4a"/> <!-- Antennae --> <path d="M0 -90 Q 30 -120 50 -90" fill="none" stroke="#4a4a4a" stroke-width="3"/> <path d="M0 -90 Q -30 -120 -50 -90" fill="none" stroke="#4a4a4a" stroke-width="3"/> </g> <!-- Left Upper Wing --> <g transform="translate(200, 150)"> <path d="M0 -20 C -50 -80, -120 -80, -150 -20 S -120 60, -50 60 Z" fill="url(#upperWingGradient)" stroke="#333" stroke-width="2"/> <!-- Wing Spots --> <path d="M0 -20 C -50 -80, -120 -80, -150 -20 S -120 60, -50 60 Z" fill="url(#spotPattern)" opacity="0.5"/> </g> <!-- Right Upper Wing --> <g transform="translate(200, 150)"> <path d="M0 -20 C 50 -80, 120 -80, 150 -20 S 120 60, 50 60 Z" fill="url(#upperWingGradient)" stroke="#333" stroke-width="2"/> <!-- Wing Spots --> <path d="M0 -20 C 50 -80, 120 -80, 150 -20 S 120 60, 50 60 Z" fill="url(#spotPattern)" opacity="0.5"/> </g> <!-- Left Lower Wing --> <g transform="translate(200, 150)"> <path d="M0 20 C -40 60, -100 100, -120 140 S -80 180, -40 140 Z" fill="url(#lowerWingGradient)" stroke="#333" stroke-width="2"/> <!-- Wing Spots --> <path d="M0 20 C -40 60, -100 100, -120 140 S -80 180, -40 140 Z" fill="url(#spotPattern)" opacity="0.5"/> </g> <!-- Right Lower Wing --> <g transform="translate(200, 150)"> <path d="M0 20 C 40 60, 100 100, 120 140 S 80 180, 40 140 Z" fill="url(#lowerWingGradient)" stroke="#333" stroke-width="2"/> <!-- Wing Spots --> <path d="M0 20 C 40 60, 100 100, 120 140 S 80 180, 40 140 Z" fill="url(#spotPattern)" opacity="0.5"/> </g> <!-- Optional: Add shadow for depth --> <g transform="translate(200, 150)" opacity="0.2"> <ellipse cx="0" cy="160" rx="80" ry="20" fill="#000000"/> </g> </svg>Explanation of the Code:
-
SVG Container:
- The SVG has a
widthof 400px and aheightof 300px, with aviewBoxto ensure scalability. - A light blue background (
<rect>) is added for contrast.
- The SVG has a
-
Definitions (
<defs>):- Two linear gradients (
upperWingGradientandlowerWingGradient) are defined for the wings, giving them a smooth color transition. - A pattern (
spotPattern) is defined to add white circular spots on the wings for decoration.
- Two linear gradients (
-
Butterfly Body:
- The body is a rounded rectangle (
<rect>) with a circular head (<circle>). - Antennae are drawn using quadratic Bézier curves (
<path>).
- The body is a rounded rectangle (
-
Wings:
- The wings are drawn using
<path>elements with Bézier curves (CandScommands) to create smooth, symmetrical shapes. - The upper wings use the
upperWingGradient, and the lower wings use thelowerWingGradient. - A semi-transparent spot pattern is overlaid on the wings for added detail.
- The wings are drawn using
-
Shadow:
- An optional shadow (
<ellipse>) is added beneath the butterfly to give a sense of depth.
- An optional shadow (
Customization:
- Colors: Modify the
stop-colorvalues in the gradients to change the wing colors. - Size: Adjust the
width,height, andviewBoxattributes of the SVG to scale the butterfly. - Patterns: Customize the
spotPatternby changing the size, shape, or opacity of the spots. - Details: Add more intricate patterns or details to the wings by modifying the
<path>elements or adding additional shapes.
You can copy this code into an HTML file or an SVG editor (like Inkscape) to view and further customize the butterfly.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- o4-mini-2025-04-16Compare side by side →
qwq-32bCompare side by side →
- o3-miniCompare side by side →
llama-4-maverick-03-26-experimentalCompare side by side →
gemini-2.0-flash-001Compare side by side →
gemini-2.5-pro-preview-03-25Compare side by side →
gemini-2.5-flash-preview-04-17Compare side by side →
- grok-3-preview-02-24Compare side by side →
- o3-miniCompare side by side →
gemini-2.0-flash-001Compare side by side →
- grok-3-preview-02-24Compare side by side →
- grok-3-mini-betaCompare side by side →