Image Optimisation
Images are often the heaviest part of a web page. A page can have clean code, good routing, and a fast deployment while still feeling slow because it sends oversized images to every visitor. Vercel Image Optimization helps deliver appropriately sized, modern image responses, especially for frameworks such as Next.js, but it does not remove the need to choose images carefully.
This lesson uses the British spelling in the title from the requested outline, while still using Vercel's product name, Image Optimization, when referring to the platform feature. The practical goal is the same: make images faster, more stable, and more cost-aware.
Why Large Images Hurt
A large image affects more than download size. It can delay the largest visible element on the page, waste mobile data, increase bandwidth, block a page from feeling ready, and cause layout shift if dimensions are missing. A hero image that looks fine on a design canvas may be far too large for a phone.
Beginners often treat image files as content rather than performance-critical assets. Production users do not care that the original photo was beautiful at 6000 pixels wide if the page takes too long to show it. The browser needs the right image for the context.
Before deploying, ask:
Is this image necessary?
Is the source file reasonably sized?
Does the browser need this resolution?
Is the image above the fold?
Will it cause layout shift?
Will it be requested by many users?
Does it come from a trusted source?
A good image strategy starts before the platform optimizer runs.
What Vercel Image Optimization Helps With
Vercel Image Optimization can resize, optimize, and deliver images in ways that are better suited to the requesting device and browser. In a Next.js app, the next/image component integrates with this behavior. Instead of every user receiving the same oversized file, the app can request a version that better matches the displayed size and supported formats.
This helps performance, but it is not a license to upload careless originals. Optimization still consumes platform resources. High traffic, many unique image sizes, remote images, and very large originals can affect usage and cost.
Think of image optimization as a delivery layer. It helps deliver images intelligently. It does not decide whether the image belongs on the page, whether the original is sensible, or whether the project can afford the expected usage.
Next.js Image Basics
In Next.js, the Image component is the common path for optimized images:
import Image from 'next/image';
export function ProfilePhoto() {
return (
<Image
src="/profile.jpg"
alt="Profile photo"
width={400}
height={400}
/>
);
}
The alt text matters for accessibility. Width and height help reserve space and reduce layout shift. The source can be a local public image or a configured remote image depending on the app.
Do not mechanically replace every image tag without reviewing behavior. Some images are decorative, some need responsive sizes, some need priority because they are the largest above-the-fold image, and some should not be optimized through the same path. Use the component deliberately.
Remote Images
Remote images need special attention. If an app loads images from a CMS, product catalog, user profile service, or external domain, configure allowed remote sources explicitly. This protects your app from accidentally optimizing arbitrary remote URLs and makes the image policy easier to review.
A conceptual Next.js configuration might allow a known image host:
const nextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'images.example.com'
}
]
}
};
export default nextConfig;
Keep this list narrow. If the app accepts user-provided image URLs, validate them. Avoid becoming an open image proxy. Remote configuration is part of security and cost control, not just convenience.
Layout Stability
Layout shift happens when content moves after the page starts loading. Images cause layout shift when the browser does not know how much space to reserve. Users may try to click a button, then an image loads and pushes the button away. That feels broken even if the page eventually looks correct.
Reserve stable dimensions. Use width and height, CSS aspect ratios, or layout patterns that keep space predictable. Test pages on slow network settings where late-loading images are easier to notice.
For content teams, this means image rules matter. If editors upload images with wildly different aspect ratios, cards may jump, crop awkwardly, or create inconsistent layouts. A CMS workflow should document expected dimensions and aspect ratios.
Hero Images
Hero images need extra care because they often affect Largest Contentful Paint. A giant hero image can make the whole page feel slow. Compress the original, use the right dimensions, and avoid loading several competing above-the-fold images.
If a hero image is decorative and does not communicate useful content, ask whether it is worth the performance cost. If it is essential to the product or story, invest in making it fast and stable. Use realistic testing on mobile, not only a desktop monitor on fast internet.
For branded and product pages, image quality still matters. Optimization should not make the image blurry, distorted, or misleading. The best result balances visual quality, file size, layout stability, and user need.
Cost And Usage Awareness
Image Optimization can have plan limits and usage-based pricing. The exact numbers can change, so check Vercel's current limits and pricing for the project plan. The important operational habit is to connect image choices to expected traffic.
A small personal portfolio with a few images has a different risk profile than an ecommerce catalog with thousands of products, user-uploaded images, and paid traffic. Remote images from a CMS can create many optimized variants. A social campaign can create a sudden traffic spike. A gallery page can multiply requests quickly.
For commercial, client, business, paid, ad-supported, or production business projects, decide who monitors usage and who pays for overages. Do not describe image optimization as free performance. It is a platform feature with real resource use.
Alternatives And Complements
Vercel Image Optimization is not the only part of image performance. You can also compress source images before upload, choose better formats, crop images to the actual subject, avoid unnecessary carousels, lazy-load below-the-fold images, use CSS for simple decoration, and remove images that do not serve users.
For user uploads, store files in a real storage service, not in the Git repository. For frequently changing images, use a CMS or object storage workflow. For private images, design access control carefully; public optimized URLs are not the same thing as private storage.
A Practical Image Review Workflow
A useful image review starts with the page, not the file. Open the page in a Preview Deployment, identify the images that appear before the user scrolls, and decide which one is most important to the page's purpose. That image deserves the most attention because it often shapes the first impression and the largest visible content.
Next, inspect the source asset. If the displayed image is a small card thumbnail but the source is a huge photo, fix the source workflow. If the same image appears in many places, decide whether each placement needs the same crop and quality. A product thumbnail, a detail-page image, and a social sharing image may need different dimensions.
Then test on a slower connection. Browser DevTools network throttling is not perfect, but it quickly reveals whether the page depends on heavy images. Watch whether text appears before images, whether layout space is reserved, and whether the important image arrives soon enough for the page to feel usable.
Finally, connect the review to ownership. If developers optimize images but content editors can upload any file later, the problem will return. Document recommended dimensions, maximum source sizes, allowed formats, and where images should be stored. A small content rule can prevent many future performance regressions.
Accessibility And Meaning
Image optimization should not erase accessibility. If an image communicates information, write useful alt text. If an image is purely decorative, it may need empty alt text or a CSS treatment depending on the framework and markup. The right choice depends on what the image means in context.
Do not write alt text as a pile of keywords. Write what a user needs to know if they cannot see the image. For a product image, that might include the product name or important visual detail. For a chart, the surrounding text should explain the data. For a decorative background, the image may not need to be announced at all.
Performance, accessibility, and design should reinforce each other. A fast image that is confusing or inaccessible is not a complete win. A beautiful image that makes the page slow or unstable is also not a complete win.
Common Mistakes
The first mistake is uploading huge originals and assuming the platform will make every consequence disappear.
The second mistake is forgetting alt text or treating it as an SEO keyword box instead of accessibility text.
The third mistake is allowing broad remote image sources.
The fourth mistake is ignoring layout shift.
The fifth mistake is putting user uploads in the repository.
The sixth mistake is ignoring image optimization usage until the bill or limit warning arrives.
Review Questions
- Why can images dominate page performance?
- What does Vercel Image Optimization help with?
- Why do dimensions matter for layout stability?
- Why should remote image sources be configured narrowly?
- What image questions should a commercial project ask before launch?
- Why is optimization not a replacement for choosing sensible source images?