Below is a detailed SVG code for a butterfly illustration. This design includes symmetrical wings with gradient colors, patterns, and a simple body. The butterfly is stylized but detailed enough to look visually appealing. You can copy this code into an HTML file or an SVG editor to view and customize it further.
<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="#f0f8ff"/>
<!-- Define Gradients for Wings -->
<defs>
<linearGradient id="wingGradient1" 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>
<linearGradient id="wingGradient2" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#88d8b0;stop-opacity:1"/>
<stop offset="100%" style="stop-color:#ffcc5c;stop-opacity:1"/>
</linearGradient>
</defs>
<!-- Butterfly Body -->
<g transform="translate(200, 150)">
<!-- Body -->
<rect x="-10" y="-50" width="20" height="100" rx="10" fill="#4a4a4a"/>
<!-- Head -->
<circle cx="0" cy="-60" r="10" fill="#4a4a4a"/>
<!-- Antennae -->
<path d="M0 -60 Q 20 -90 30 -80" fill="none" stroke="#4a4a4a" stroke-width="2"/>
<path d="M0 -60 Q -20 -90 -30 -80" fill="none" stroke="#4a4a4a" stroke-width="2"/>
<!-- Left Upper Wing -->
<path d="M0 0
C -50 -50, -100 -50, -120 0
C -140 50, -100 100, -50 100
C -30 80, -10 50, 0 0"
fill="url(#wingGradient1)" stroke="#333" stroke-width="2"/>
<!-- Left Lower Wing -->
<path d="M0 0
C -30 50, -70 100, -90 150
C -110 200, -70 220, -30 200
C -20 150, -10 100, 0 0"
fill="url(#wingGradient2)" stroke="#333" stroke-width="2"/>
<!-- Right Upper Wing (Mirrored) -->
<path d="M0 0
C 50 -50, 100 -50, 120 0
C 140 50, 100 100, 50 100
C 30 80, 10 50, 0 0"
fill="url(#wingGradient1)" stroke="#333" stroke-width="2"/>
<!-- Right Lower Wing (Mirrored) -->
<path d="M0 0
C 30 50, 70 100, 90 150
C 110 200, 70 220, 30 200
C 20 150, 10 100, 0 0"
fill="url(#wingGradient2)" stroke="#333" stroke-width="2"/>
<!-- Wing Patterns (Left Upper Wing) -->
<g fill="none" stroke="#ffffff" stroke-width="1" opacity="0.8">
<path d="M-50 50 C -70 30, -90 30, -100 50"/>
<path d="M-60 70 C -80 50, -100 50, -110 70"/>
<circle cx="-80" cy="20" r="5" fill="#ffffff"/>
</g>
<!-- Wing Patterns (Right Upper Wing) -->
<g fill="none" stroke="#ffffff" stroke-width="1" opacity="0.8">
<path d="M50 50 C 70 30, 90 30, 100 50"/>
<path d="M60 70 C 80 50, 100 50, 110 70"/>
<circle cx="80" cy="20" r="5" fill="#ffffff"/>
</g>
<!-- Wing Patterns (Left Lower Wing) -->
<g fill="none" stroke="#ffffff" stroke-width="1" opacity="0.8">
<path d="M-30 150 C -50 130, -70 130, -80 150"/>
<circle cx="-60" cy="170" r="4" fill="#ffffff"/>
</g>
<!-- Wing Patterns (Right Lower Wing) -->
<g fill="none" stroke="#ffffff" stroke-width="1" opacity="0.8">
<path d="M30 150 C 50 130, 70 130, 80 150"/>
<circle cx="60" cy="170" r="4" fill="#ffffff"/>
</g>
</g>
</svg>
Explanation of the Code:
- SVG Canvas: The SVG has a width of 400px and a height of 300px, with a viewBox to ensure scalability.
- Background: A light blue rectangle (
<rect>) serves as the background (optional).
- Gradients: Two linear gradients (
wingGradient1 and wingGradient2) are defined in the <defs> section for the wings, giving them a colorful, blended appearance.
- Body: The butterfly's body is created using a rounded rectangle (
<rect>) for the torso, a circle (<circle>) for the head, and curved paths (<path>) for the antennae.
- Wings: The wings are drawn using
<path> elements with cubic Bezier curves (C) to create smooth, flowing shapes. The upper and lower wings are mirrored for symmetry.
- Wing Patterns: Simple patterns (curves and circles) are added to the wings using
<path> and <circle> elements, with white strokes and fills for decoration.
- Transform: The entire butterfly is centered on the canvas using a
transform="translate(200, 150)" on the <g> group.
Customization:
- Colors: Modify the
stop-color values in the gradients or the fill attributes to change the butterfly's colors.
- Size: Adjust the
width, height, and viewBox attributes of the SVG to resize the butterfly.
- Patterns: Add more complex patterns or shapes to the wings by extending the
<g> groups for wing patterns.
- Animation: You can add animations (e.g., flapping wings) using CSS or SMIL animations.
To view this SVG, save the code in a .svg file or embed it in an HTML file like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Butterfly SVG</title>
</head>
<body>
<!-- Paste the SVG code here -->
</body>
</html>
This will render a beautiful butterfly illustration that you can further customize as needed!