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

write svg code for detailed and realistic butterfly

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with grok-3-mini-beta’s answer.
  1. User

    write svg code for detailed and realistic butterfly

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

    1. SVG Structure:

      • The SVG canvas is set to 400x400 pixels, with a viewBox to ensure scalability.
      • A light background (rect) is added for contrast.
    2. 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.
    3. 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.
    4. 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.
    5. Antennae:

      • The antennae are simple quadratic Bézier curves (Q) with a brown stroke.
    6. 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 wingPattern to the wings by adding fill="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.

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