Skip to content

CDN Embedding

Learn how to embed Pixelflare images in your websites and applications.

Direct URLs

Every uploaded image gets a permanent CDN URL:

https://cdn.yourdomain.com/{image-id}
https://cdn.yourdomain.com/{image-id}/{variant}

Image Variants

Request specific sizes on-the-fly:

html
<img src="https://cdn.yourdomain.com/abc123/w800" alt="Image">

Available variants:

  • w128, w256, w512, w800, w1024, w1600, w2400
  • thumb - 256x256 square thumbnail

Responsive Images

Use srcset for responsive images:

html
<img
  src="https://cdn.yourdomain.com/abc123/w800"
  srcset="
    https://cdn.yourdomain.com/abc123/w512 512w,
    https://cdn.yourdomain.com/abc123/w800 800w,
    https://cdn.yourdomain.com/abc123/w1600 1600w
  "
  sizes="(max-width: 768px) 100vw, 800px"
  alt="Responsive image"
>

Markdown

markdown
![Alt text](https://cdn.yourdomain.com/abc123/w800)

Best Practices

  1. Always specify a variant - Don't serve full-size images when smaller will do
  2. Use responsive images - Leverage srcset for better performance
  3. Set alt text - For accessibility and SEO
  4. Lazy loading - Use loading="lazy" for images below the fold

See Also

Released under the MIT License.