write svg code for detailed and realistic butterfly
- User
write svg code for detailed and realistic butterfly
- Assistant
Creating a detailed and realistic butterfly in SVG requires careful attention to shapes, gradients, and patterns to mimic the intricate details of a butterfly's wings. Below is an example of SVG code for a realistic butterfly, using paths, gradients, and filters to achieve a detailed effect. This example is inspired by the Monarch butterfly, known for its vibrant orange and black wings.
<svg width="400" height="400" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg"> <!-- Definitions for gradients, patterns, and filters --> <defs> <!-- Gradient for the orange wing color --> <radialGradient id="wingGradient" cx="50%" cy="50%" r="50%"> <stop offset="0%" style="stop-color:#ff8c00;stop-opacity:1" /> <stop offset="100%" style="stop-color:#ff4500;stop-opacity:1" /> </radialGradient> <!-- Gradient for the black veins --> <linearGradient id="veinGradient" x1="0%" y1="0%" x2="100%" y2="100%"> <stop offset="0%" style="stop-color:#000000;stop-opacity:1" /> <stop offset="100%" style="stop-color:#333333;stop-opacity:0.8" /> </linearGradient> <!-- Filter for shadow effect --> <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%"> <feGaussianBlur in="SourceAlpha" stdDeviation="3" /> <feOffset dx="2" dy="2" result="offsetblur" /> <feMerge> <feMergeNode /> <feMergeNode in="SourceGraphic" /> </feMerge> </filter> <!-- Pattern for wing texture --> <pattern id="wingPattern" patternUnits="userSpaceOnUse" width="20" height="20"> <circle cx="10" cy="10" r="2" fill="rgba(255, 255, 255, 0.2)" /> </pattern> </defs> <!-- Background (optional, for contrast) --> <rect width="400" height="400" fill="#f0f8ff" /> <!-- Butterfly Body --> <path d="M200 100 Q195 150 200 200 Q205 150 200 100" fill="#4a2c2a" stroke="#3c2523" stroke-width="2" filter="url(#shadow)" /> <!-- Left Upper Wing --> <path d="M200 100 C150 50, 100 50, 80 100 S120 150, 200 150" fill="url(#wingGradient)" stroke="#000" stroke-width="1" filter="url(#shadow)" /> <!-- Left Upper Wing Veins --> <path d="M200 100 C180 80, 140 70, 120 90" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 100 C170 90, 130 80, 110 110" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 100 C160 100, 120 110, 100 130" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <!-- Left Lower Wing --> <path d="M200 150 C150 200, 100 200, 80 150 S120 100, 200 100" fill="url(#wingGradient)" stroke="#000" stroke-width="1" filter="url(#shadow)" /> <!-- Left Lower Wing Veins --> <path d="M200 150 C180 170, 140 180, 120 160" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 150 C170 160, 130 170, 110 140" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 150 C160 150, 120 140, 100 120" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <!-- Right Upper Wing --> <path d="M200 100 C250 50, 300 50, 320 100 S280 150, 200 150" fill="url(#wingGradient)" stroke="#000" stroke-width="1" filter="url(#shadow)" /> <!-- Right Upper Wing Veins --> <path d="M200 100 C220 80, 260 70, 280 90" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 100 C230 90, 270 80, 290 110" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 100 C240 100, 280 110, 300 130" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <!-- Right Lower Wing --> <path d="M200 150 C250 200, 300 200, 320 150 S280 100, 200 100" fill="url(#wingGradient)" stroke="#000" stroke-width="1" filter="url(#shadow)" /> <!-- Right Lower Wing Veins --> <path d="M200 150 C220 170, 260 180, 280 160" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 150 C230 160, 270 170, 290 140" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <path d="M200 150 C240 150, 280 140, 300 120" fill="none" stroke="url(#veinGradient)" stroke-width="2" /> <!-- Antennae --> <path d="M195 100 Q180 70 170 60" fill="none" stroke="#4a2c2a" stroke-width="1" /> <path d="M205 100 Q220 70 230 60" fill="none" stroke="#4a2c2a" stroke-width="1" /> <!-- Wing Spots (white spots on black edges, typical of Monarch) --> <circle cx="90" cy="90" r="3" fill="white" /> <circle cx="100" cy="110" r="3" fill="white" /> <circle cx="310" cy="90" r="3" fill="white" /> <circle cx="300" cy="110" r="3" fill="white" /> <circle cx="90" cy="160" r="3" fill="white" /> <circle cx="100" cy="140" r="3" fill="white" /> <circle cx="310" cy="160" r="3" fill="white" /> <circle cx="300" cy="140" r="3" fill="white" /> </svg>Explanation of the Code:
-
SVG Structure:
- The SVG canvas is set to 400x400 pixels, with a
viewBoxto ensure scalability. - A light background (
rect) is added for contrast.
- The SVG canvas is set to 400x400 pixels, with a
-
Definitions (
<defs>):- Gradients: A radial gradient (
wingGradient) is used for the orange wing color, and a linear gradient (veinGradient) is used for the black veins. - Filter: A shadow filter (
shadow) is applied to give depth to the wings and body. - Pattern: A subtle pattern (
wingPattern) is defined but not used in this example; you can apply it to the wings for added texture.
- Gradients: A radial gradient (
-
Butterfly Body:
- The body is drawn using a quadratic Bézier curve (
Q) to create a smooth, elongated shape, with a brown fill and a shadow effect.
- The body is drawn using a quadratic Bézier curve (
-
Wings:
- Each wing is drawn using a cubic Bézier curve (
C) and a smooth curve (S) to create the characteristic butterfly wing shape. - The wings are filled with the orange gradient and outlined in black.
- Veins are drawn as paths with a gradient fill to add realism.
- Each wing is drawn using a cubic Bézier curve (
-
Antennae:
- The antennae are simple quadratic Bézier curves (
Q) with a brown stroke.
- The antennae are simple quadratic Bézier curves (
-
Spots:
- White circles are added to the edges of the wings to mimic the Monarch butterfly's distinctive black-and-white pattern.
Customization Tips:
- Colors: Adjust the gradient colors in
<defs>to match other butterfly species (e.g., blue for a Morpho butterfly). - Patterns: Apply the
wingPatternto the wings by addingfill="url(#wingPattern)"to the wing paths for a textured effect. - Details: Add more intricate vein patterns or additional spots for other butterfly species.
- Animation: You can add CSS or SMIL animations to make the wings flap or the butterfly move.
This SVG code provides a foundation for a realistic butterfly. You can further enhance it by adding more details, textures, or animations depending on your needs.
-
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
- grok-3-preview-02-24Compare side by side →
- chatgpt-4o-latest-20250326Compare side by side →
llama-4-maverick-17b-128e-instructCompare side by side →
- gpt-4.1-2025-04-14Compare side by side →
- grok-3-mini-betaCompare side by side →
qwen3-30b-a3bCompare side by side →
- gpt-4.1-mini-2025-04-14Compare side by side →
qwen3-235b-a22bCompare side by side →
- grok-3-mini-betaCompare side by side →