Use Netlify Image CDN to resize and crop images as they are requested, then serve a suitable format and quality for each use. For images stored with your site, start with a relative source URL; for remote images, first allowlist the source domain. If your project uses a supported framework, its image component may be the simpler integration.
How do I optimize images on Netlify?
Netlify Image CDN transforms images on demand through /.netlify/images. It can resize and crop images, convert formats, negotiate an output format from the browser’s Accept header, and cache transformed results. Netlify Docs says these transformations do not affect build times.
As an Amazon Associate I earn from qualifying purchases.
For a same-site image, put its path in the url parameter and add only the dimensions and behavior you need:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
/.netlify/images?url=/images/photo.jpg&w=800
Relative source paths need no additional configuration. Match the output dimensions to the image’s rendered use rather than serving a needlessly large original. For repeated uses at different sizes, request the dimensions appropriate to each context.
#1 Best Overall
How do I resize or crop an image with Netlify Image CDN?
Set dimensions and fit behavior
The w and h parameters accept integer pixel dimensions. You can set one or both. The default fit is contain, which preserves the image’s proportions. Use cover to fill the requested dimensions by cropping; position controls which region remains visible. Use fill only when stretching the image to the exact dimensions is acceptable.
/.netlify/images?url=/images/photo.jpg&w=600&h=400&fit=cover&position=center
For a card image, inspect the result at its actual display size and choose a position that keeps the important subject in frame. Cropping can remove content near the edges; fill can distort it.
Choose an output format and quality
Use fm to force an output format: avif, jpg, png, webp, gif, or blurhash. Without fm, Netlify checks browser support in this order: WebP, then AVIF, then the original format. A request that only specifies a source can therefore still receive a modern format when the browser accepts it.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
The q parameter sets lossy conversion quality as a whole number from 1 to 100. Netlify documents a default of 75 for supported lossy conversions. This example shows the syntax, not a universally best setting:
/.netlify/images?url=/images/photo.jpg&w=800&fm=avif&q=75
Compare the result visually with the original, especially for text, fine edges, gradients, and photographs. The appropriate format and quality depend on the image and its use; Netlify’s documentation does not prescribe one best value for every image.
Does Netlify automatically convert images to WebP or AVIF?
Netlify negotiates the output format based on the browser’s Accept header when you do not set fm. Its documented preference order is WebP, then AVIF, then the source format. Set fm when you need to request a particular supported format rather than rely on negotiation.
Rank #3
Forcing a format is a choice, not a guarantee that it is best for every asset. Check the rendered output in the contexts and browsers you support.
How do I use remote images with Netlify Image CDN?
Remote sources must be permitted in your site’s netlify.toml under images.remote_images. Keep the pattern as narrow as your actual image sources allow. For example:
[images]
remote_images = ['https://images.example.com/.*']
Then provide the complete remote image URL as the url parameter. Follow Netlify’s current TOML escaping guidance when a regular expression needs escaping; a single-quoted literal string or correctly escaped backslashes can avoid ambiguity.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
- The remote image must be publicly accessible, or use a self-authorizing URL such as a presigned URL.
- Netlify does not forward credential-bearing
AuthorizationorCookieheaders to remote sources. - If the request fails for a remote source, check the allowlist pattern and whether the source can be fetched without those credentials.
Should I use a direct URL or a framework image component?
Use a direct /.netlify/images URL when you want to control transformation parameters explicitly or are working outside the documented framework integrations. If your framework is supported, its standard image component can wire requests into Image CDN, subject to the relevant version and configuration prerequisites.
| Framework | Documented integration and configuration |
|---|---|
| Angular | NgOptimizedImage automatically uses Image CDN. Configure remote domains with images.remote_images. |
| Astro | <Image /> automatically uses Image CDN. Configure remote images in astro.config.mjs with image.domains or image.remotePatterns. |
| Gatsby | Set NETLIFY_IMAGE_CDN=true and use supported Contentful, Drupal, or WordPress source plugins. Netlify’s documentation distinguishes requirements by Gatsby version. |
| Next.js | The documented route requires Next.js 13.5 or later and Netlify adapter v5. Configure remote paths with remotePatterns in next.config.js. |
| Nuxt | nuxt/image automatically uses Image CDN. Configure remote domains in image.domains in nuxt.config.ts. |
Framework prerequisites and configuration can change. Verify the current Netlify documentation for your framework and version before relying on automatic integration.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →How do caching and local testing work?
Netlify uniquely caches transformed output at the edge, so repeated requests for the same transformation can use the cached result. Image CDN respects atomic deploys by default: when a relative source image changes in a new deploy, new requests trigger transformations against the new source.
Best Value
Use Netlify Dev to test transformations locally in an environment intended to mimic production. Check representative images and transformation parameters before deploying broadly.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.What limitations should I know about?
- Image CDN is not supported with Split Testing; Netlify warns it may produce inconsistent results between branches.
- Netlify says Image CDN is not currently part of its HIPAA-compliant hosting offering.
- Cross-site redirects for image transformations are discouraged because they may negatively affect performance.
- Do not confuse the current
/.netlify/imagesroute and itsurl,w,h, andfitparameters with legacy Large Media syntax such asnf_resize=fitornf_resize=smartcrop. Existing Large Media setups are a separate workflow.
Troubleshooting Netlify Image CDN
The transformed image does not load
- For a local asset, check that the path in
urlmatches the deployed file path. - For a remote asset, verify that its URL matches an
images.remote_imagespattern and that the image is publicly accessible or self-authorizing. - Do not expect Netlify to pass through remote-source authorization or cookie headers.
The result has the wrong dimensions or crop
- Check that
wandhare integer pixel values. - Confirm the fit mode:
containpreserves proportions,covercrops to fill, andfillmay distort. - With
cover, adjustpositionto retain the image region you need.
The output format is unexpected
If fm is omitted, the browser’s Accept header affects negotiation. Specify a supported value with fm when you need to force the format, and inspect lossy output at the chosen q value.
Framework images are not using Image CDN
Check that the framework and adapter versions meet the documented prerequisite, and that remote-image settings are in the framework’s expected configuration file. Gatsby additionally requires NETLIFY_IMAGE_CDN=true and one of the supported source plugins.
Free tools Windows power users keep installed
One-click scans. No signup required.
Or skip the browser setup
If your task is capturing a web page as an image or PDF rather than optimizing image assets served by Netlify, ScreenshotNeo is a separate website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. For example, using cURL:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




