Serving car logos fast
A logo in a make picker should cost a couple of kilobytes, not the 50 KB of a print-size PNG. This guide uses measurements from the Motomarks image CDN to pick a format and size for each slot, then covers loading, fallbacks and keys. For every URL parameter, see the image CDN reference.
WebP is smaller at every size
| Preset | Pixels | PNG median | WebP median | WebP saving |
|---|---|---|---|---|
| size=xs | 64 | 1.9 KB | 1.3 KB | 32% |
| size=sm | 128 | 4.1 KB | 2.8 KB | 31% |
| size=md | 256 | 9.2 KB | 6.0 KB | 35% |
| size=lg | 512 | 20.9 KB | 12.9 KB | 38% |
| size=xl | 1024 | 55.5 KB | 27.5 KB | 50% |
The spread between presets matters more than the format: a median xs WebP is 1.3 KB against 27.5 KB at xl. Requesting xl and scaling it down in CSS costs roughly 22 times the bytes of the right preset. WebP is the CDN default; ask for PNG only where the consumer cannot decode WebP, such as some email clients and document generators.
Pick the preset from the slot
| Slot | Preset | Why |
|---|---|---|
| Table rows, filters, chips (16–32 px) | size=xs | 64 px covers 32 px at 2x. |
| Make pickers, list items (40–64 px) | size=sm | 128 px covers 64 px at 2x. |
| Cards, search results (96–128 px) | size=md | 256 px covers 128 px at 2x. |
| Brand page headers (160–256 px) | size=lg | 512 px covers 256 px at 2x. |
| Print, hero art, OG images | size=xl | 1024 px; PNG if the consumer cannot read WebP. |
When one component renders at several sizes, let the browser choose with srcset. The React and Vue components do the same calculation in code with sizeFor().
<img
src="https://motomarks.io/img/byd?type=badge&size=sm&token=pk_…"
srcset="https://motomarks.io/img/byd?type=badge&size=xs&token=pk_… 64w,
https://motomarks.io/img/byd?type=badge&size=sm&token=pk_… 128w,
https://motomarks.io/img/byd?type=badge&size=md&token=pk_… 256w"
sizes="32px"
width="32" height="32"
alt="BYD logo"
loading="lazy" decoding="async">Load the one logo that matters first
On a brand page the logo is often the largest element above the fold, so it decides Largest Contentful Paint. Preload that one image with high priority. Everything else, such as table rows, pickers and related brands, should use loading="lazy" and explicit width and height so the layout does not shift.
<!-- Only for the one logo above the fold, e.g. a brand page header -->
<link rel="preload" as="image" fetchpriority="high"
href="https://motomarks.io/img/byd?type=full&size=lg&token=pk_…">Caching and fallbacks
Stable URLs, cached at the edge
A logo URL never changes when the manufacturer updates its mark; the file behind it does. Responses are cached at CloudFront edges and carry ETag and Last-Modified, so browsers revalidate with a cheap 304. See caching for what to cache on your side.
A fallback for every logo
Handle onerror by showing the brand initial at the same size. It covers unknown slugs, revoked keys and offline clients without breaking the row.
Restrict publishable keys
Add your domains to the pk_ key in the dashboard. Restricted keys refuse requests from other sites, and requests without an Origin or Referer fail closed, which is why server-side image optimizers need to be bypassed (see the Next.js guide).
Square or fixed height
aspect=square pads every mark into the same box, which keeps grids even. aspect=height keeps the mark's own width at a fixed height, which suits wordmarks in headers and partner strips.
Right-sized logos for every slot.
Create a free key and request any brand at any preset from one URL pattern.
Free includes 1,000 requests per day with an attribution link. Startup and Pro remove attribution.