Skip to content
TheChatArchiveThe Chat Archive
grok-3-preview-02-24· xAIHugging Face LMArena Human Preference 140K

write detailed svg code for butterfly

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-3-7-sonnet-20250219’s answer.
  1. User

    write detailed svg code for butterfly

  2. 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:

    1. SVG Container:

      • The SVG has a width of 400px and a height of 300px, with a viewBox to ensure scalability.
      • A light blue background (<rect>) is added for contrast.
    2. Definitions (<defs>):

      • Two linear gradients (upperWingGradient and lowerWingGradient) 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.
    3. Butterfly Body:

      • The body is a rounded rectangle (<rect>) with a circular head (<circle>).
      • Antennae are drawn using quadratic Bézier curves (<path>).
    4. Wings:

      • The wings are drawn using <path> elements with Bézier curves (C and S commands) to create smooth, symmetrical shapes.
      • The upper wings use the upperWingGradient, and the lower wings use the lowerWingGradient.
      • A semi-transparent spot pattern is overlaid on the wings for added detail.
    5. Shadow:

      • An optional shadow (<ellipse>) is added beneath the butterfly to give a sense of depth.

    Customization:

    • Colors: Modify the stop-color values in the gradients to change the wing colors.
    • Size: Adjust the width, height, and viewBox attributes of the SVG to scale the butterfly.
    • Patterns: Customize the spotPattern by 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.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.