Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
netlify avatar

Netlify Image Cdn

  • 1.4k installs
  • 31 repo stars
  • Updated August 4, 2026
  • netlify/context-and-tools

netlify-image-cdn is a Claude Code skill that generates responsive, optimized image markup and Netlify Image CDN transformation URLs for developers who serve images on Netlify-hosted sites.

About

netlify-image-cdn is a Netlify-focused Claude Code skill for the built-in /.netlify/images endpoint that transforms images on the fly without extra configuration for local assets. The skill walks through query parameters such as w, h, fit, and q, remote image allowlisting, clean URL rewrites, and composing user-upload uploads with Functions plus Blobs. Developers reach for netlify-image-cdn when adding responsive img markup, tuning compression quality, or wiring upload-to-CDN pipelines on Netlify. The guide covers hosted checkout-style image delivery patterns and transformation URLs developers can drop directly into HTML or framework components.

  • Built-in /.netlify/images endpoint requires zero configuration for local assets
  • Supports 8 query parameters including w, h, fit, fm, q for on-the-fly resizing and format conversion
  • Automatic format negotiation preferring AVIF then WebP when fm parameter is omitted
  • Remote image allowlisting via netlify.toml with regex patterns for external sources
  • Composes with Netlify Functions and Blobs for user-uploaded image pipelines

Netlify Image Cdn by the numbers

  • 1,422 all-time installs (skills.sh)
  • +126 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #305 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/netlify/context-and-tools --skill netlify-image-cdn

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.4k
repo stars31
Last updatedAugust 4, 2026
Repositorynetlify/context-and-tools

How do you optimize images on Netlify with Image CDN?

Generate responsive, optimized image markup and transformation URLs for their Netlify-hosted sites.

Who is it for?

Frontend developers shipping image-heavy sites on Netlify who need on-the-fly resize, crop, and quality transforms without a separate CDN service.

Skip if: Teams not on Netlify or projects that already rely on Cloudinary, imgix, or a self-managed image pipeline.

When should I use this skill?

A developer asks for Netlify Image CDN URLs, responsive image markup, remote image allowlisting, or upload-to-transform workflows on Netlify.

What you get

Responsive img markup, /.netlify/images transformation URLs, remote allowlist config, and upload pipeline patterns with Functions and Blobs.

  • responsive img markup
  • transformation URLs
  • remote allowlist config

By the numbers

  • Every Netlify site exposes a built-in /.netlify/images transformation endpoint

Files

SKILL.mdMarkdownGitHub ↗

Netlify Image CDN

Every Netlify site has a built-in /.netlify/images endpoint for on-the-fly image transformation. No configuration required for local images.

Basic Usage

<img src="/.netlify/images?url=/photo.jpg&w=800&h=600&fit=cover&q=80" />

Query Parameters

ParamDescriptionValues
urlSource image path (required)Relative path or absolute URL
wWidth in pixelsAny positive integer
hHeight in pixelsAny positive integer
fitResize behaviorcontain (default), cover, fill
positionCrop alignment (with cover)center (default), top, bottom, left, right
fmOutput formatavif, webp, jpg, png, gif, blurhash
qQuality (lossy formats)1-100 (default: 75)

When fm is omitted, Netlify auto-negotiates the best format based on browser support (preferring webp, then avif).

Remote Image Allowlisting

External images must be explicitly allowed in netlify.toml:

[images]
remote_images = ["https://example\\.com/.*", "https://cdn\\.images\\.com/.*"]

Values are regex patterns.

When referencing an allow-listed remote image, percent-encode the source URL before placing it in the url parameter:

<!-- source: https://cdn.example.com/marketing/banner.jpg -->
<img src="/.netlify/images?url=https%3A%2F%2Fcdn.example.com%2Fmarketing%2Fbanner.jpg&w=800&fm=webp&q=80" />

Percent-encode the source value (e.g. with encodeURIComponent) whenever it contains characters that would otherwise be read as Image CDN params — ?, &, =, #, or whitespace. This applies to remote URLs and relative paths alike (a filename or user-generated key can contain them too, e.g. url=/uploads/a%26b.jpg). Basic paths without those characters don't need encoding.

Clean URL Rewrites

Create user-friendly image URLs with redirects:

# Basic optimization
[[redirects]]
from = "/img/*"
to = "/.netlify/images?url=/:splat"
status = 200

# Preset: thumbnail
[[redirects]]
from = "/img/thumb/:key"
to = "/.netlify/images?url=/uploads/:key&w=150&h=150&fit=cover"
status = 200

# Preset: hero
[[redirects]]
from = "/img/hero/:key"
to = "/.netlify/images?url=/uploads/:key&w=1200&h=675&fit=cover"
status = 200

Caching

  • Transformed images are cached at the CDN edge automatically
  • Cache invalidates on new deploys
  • Set cache headers on source images to control caching:
[[headers]]
for = "/uploads/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"

User-Uploaded Images

Combine Netlify Functions (upload handler) + Netlify Blobs (storage) + Image CDN (serving/transforming) to build a complete user-uploaded image pipeline. See references/user-uploads.md for the full pattern.

Related skills

How it compares

Pick netlify-image-cdn when the site already deploys on Netlify and you want zero-setup transforms instead of adding an external image SaaS.

FAQ

What endpoint does Netlify Image CDN use?

Netlify Image CDN serves transformed images from the /.netlify/images endpoint on every Netlify site. Developers pass the source url plus query parameters such as w, h, fit, and q to resize, crop, and compress images on the fly.

Does Netlify Image CDN need configuration for local images?

Netlify Image CDN requires no extra configuration for local site images referenced through /.netlify/images. Remote image sources must be allowlisted before Netlify will fetch and transform third-party URLs.

Frontend Developmentfrontendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.