SVG vs PNG Logos: Why Format Matters for Brand APIs

SVG vs PNG Logos: Why Format Matters for Brand APIs

Jasper Koers 8 min read Engineering

The Logo Format Problem

When you request brand data from an API, you expect to get a logo you can actually use. But logos exist in many formats across the web, and each has different strengths and trade-offs.

At Fetching Company, we have spent considerable time optimizing our logo extraction pipeline to deliver the best possible format for every brand. Here is what we have learned.

SVG: The Gold Standard

Scalable Vector Graphics (SVG) is the ideal format for logos. SVGs are resolution-independent, infinitely scalable, and typically small in file size. They render crisply on any screen, from a 13-inch laptop to a 4K display.

Advantages

  • Infinite scalability without quality loss
  • Small file sizes, often under 10KB
  • CSS-styleable: change colors, sizes, and animations with code
  • Accessible: screen readers can parse SVG text content
  • Print-ready: perfect for high-resolution output

Extraction Challenges

Not all SVGs are created equal. Some challenges we encounter:

  • Inline SVGs embedded directly in HTML rather than linked as files
  • SVGs with external references that depend on stylesheets or fonts
  • Obfuscated SVGs minified or encoded as data URIs
  • SVGs with raster images embedded inside them (defeating the purpose)

Our pipeline extracts SVGs from multiple sources: <img> tags, inline <svg> elements, CSS background-image properties, and favicon links. We clean and optimize each SVG, removing unnecessary metadata and external dependencies.

PNG: The Universal Fallback

PNG is the most widely supported raster format. Nearly every website has at least one PNG logo, often in the form of a favicon or Open Graph image.

When PNG Works Best

  • Complex illustrations that do not translate well to vectors
  • Photographic logos with gradients and textures
  • Social media sharing where platforms expect raster images
  • Favicon extraction where ICO files contain PNG data

Quality Considerations

The main challenge with PNG logos is resolution. A 32x32 favicon scaled up to 200px looks terrible. Our API returns logos with dimensions, so consumers can choose the highest resolution available:

{
  "logos": [
    {
      "url": "https://example.com/logo.svg",
      "format": "svg",
      "width": null,
      "height": null,
      "source": "inline"
    },
    {
      "url": "https://example.com/logo.png",
      "format": "png",
      "width": 512,
      "height": 512,
      "source": "og:image"
    }
  ]
}

Our Format Priority

When extracting logos, we follow this priority order:

  1. SVG from source code (inline or linked)
  2. SVG from favicon (<link rel="icon" type="image/svg+xml">)
  3. High-resolution PNG (512px+ from Apple Touch Icon or OG Image)
  4. Standard PNG/JPG from meta tags or img elements
  5. ICO favicon as the last resort

We always return all available formats so API consumers can choose what works best for their use case.

Practical Recommendations

If you are building an application that consumes brand logos:

  • Prefer SVG when available, with a PNG fallback for email clients
  • Check dimensions before displaying raster logos and skip anything under 64px
  • Cache logos locally with a reasonable TTL (we recommend 24 hours)
  • Use the format field to filter logos by type in your application

How We Handle Edge Cases

Some sites make logo extraction particularly tricky:

  • Single-page applications where logos are loaded dynamically via JavaScript
  • Lazy-loaded images that only appear after scroll
  • Canvas-rendered logos that are not standard DOM elements
  • WebP-only sites that do not serve PNG or SVG

Our headless browser approach handles all of these. By rendering the page fully before extraction, we capture logos that simpler scrapers miss entirely.

Summary

The right logo format depends on your use case. SVGs are ideal for most applications, while PNGs serve as a reliable fallback. A good brand intelligence API should return both formats with metadata so you can make the right choice for your users.

Share this article

Ready to try the API?

Extract brand data from any website with a single API call. Start free.