Improve image performance by first removing unnecessary image requests, then matching each remaining image to its rendered size, choosing a format and compression level that preserve acceptable quality, and setting loading priority based on when the image appears. For a slow Largest Contentful Paint (LCP), identify whether the delay is image discovery, transfer, or rendering before changing the file: a smaller image only helps when transfer is the bottleneck.
1. Remove image requests that do not help the page
The fastest image to download is the one the page does not need. Check whether each image contributes information or meaningfully supports the design. Remove redundant decorative images, replace simple shapes or icons with CSS where appropriate, and avoid loading images for content that users are unlikely to reach or need.
Then optimize the requests that remain. The useful order is to fit the asset to its rendered slot, choose a suitable format, compress it to the visual-quality bar, and only then tune delivery and loading priority. This prevents spending time on delivery infrastructure for bytes that could have been removed.
2. Serve dimensions that fit the rendered image
Start with the image’s displayed dimensions across common layouts, not just the source file’s dimensions. Serving a large desktop image to a small mobile slot wastes transfer. web.dev illustrates that a desktop-sized image can use 2–4 times more data than needed in its described mobile scenario; that is an example, not a guaranteed saving for every site. web.dev’s responsive image guide explains the approach.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Use srcset and sizes for responsive candidates
Provide a measured set of useful widths with srcset, and describe the image’s actual layout slot with sizes. The browser uses those hints, along with the viewport and device pixel density, to choose an appropriate candidate.
<img
src="/images/article-800.webp"
srcset="/images/article-400.webp 400w,
/images/article-800.webp 800w,
/images/article-1200.webp 1200w"
sizes="(max-width: 600px) 100vw, (max-width: 1000px) 80vw, 800px"
width="1200"
height="800"
alt="A climber approaching a mountain ridge">
The sizes expression should reflect the real CSS layout. If the image occupies half the viewport on desktop, saying it occupies the full viewport can lead the browser to select a larger candidate than necessary. See web.dev’s responsive images guide.
Keep the candidate set useful, not exhaustive
More variants can improve the match between file dimensions and rendered size, but they also increase markup, cache entries, and image-generation or storage work. Choose a limited set that covers the actual layout breakpoints and common device widths; measure before adding more variants.
Use width and height to reserve space
Set intrinsic width and height attributes when dimensions are known, even if CSS makes the image responsive. The browser can calculate an aspect ratio and reserve space before the file arrives, reducing layout movement. Keep CSS such as max-width: 100%; height: auto; if the image should shrink with its container.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
3. Choose a format and compression level for the image
There is no single best format or quality setting for every asset. Choose based on the image’s content, transparency needs, toolchain, and browser support, then inspect the result at its intended display size. web.dev’s guides cover image performance and format selection.
| Image type or need | Practical starting point | What to inspect |
|---|---|---|
| Photographs and detailed raster images | Compare WebP or AVIF with the current JPEG or other raster asset using representative samples. | Fine texture, gradients, faces, and color transitions; smaller files are not useful if artifacts are visible. |
| Transparency | Compare WebP or AVIF where your browser and publishing toolchain support the required workflow; retain an appropriate fallback if needed. | Edges against both light and dark backgrounds, plus whether transparency is preserved. |
| Logos, diagrams, charts, and line art | Use SVG when the artwork is genuinely vector-based. | Text legibility, crisp edges, and whether the asset contains raster content that changes the trade-off. |
| Existing JPEG or PNG assets | Keep them when they meet quality and performance needs; convert only after comparing actual output. | File size at the required visual quality and compatibility with the site’s delivery stack. |
Balance compression against visible artifacts
Lossy compression discards image information to reduce bytes; it can create artifacts around sharp edges and high-contrast colored text on flat backgrounds. Lossless compression retains image data, but its byte savings vary. Test representative photos, transparent images, fine textures, line art, and images with embedded text. Choose the smallest output that still meets your visual standard at the rendered size; no universal quality value is established.
Tools named by web.dev include Squoosh and ImageOptim. A hosted optimization service may save operational work, but its cost and fit depend on the site’s image volume and workflow.
When serving formats based on Accept
If the server selects an AVIF or WebP representation from the request’s Accept header, configure shared caching to distinguish those representations, including an appropriate Vary: Accept response header. Alternatively, a <picture> element can offer format alternatives in markup. Check fallback behavior and cache keys, and verify in the network panel that the browser is not downloading multiple alternatives unnecessarily.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
4. Set loading behavior according to image priority
Use native browser loading hints to reduce competition for bandwidth, but do not treat every image the same. An offscreen image can usually wait; a visible hero or likely LCP image should be discoverable and requested early.
Lazy-load images below the fold
For images that are genuinely below the initial viewport, use loading="lazy". Native lazy loading is built into browsers, so a JavaScript library is generally unnecessary for this basic behavior.
<img
src="/images/related-story.webp"
width="800"
height="533"
loading="eager"
alt="A trail through a forest">
Avoid lazy-loading images visible near the top of the page. The browser may wait until layout information is available to decide whether a lazy image is close enough to fetch, delaying discovery of an image that matters immediately. web.dev’s lazy-loading guidance recommends reserving this behavior for offscreen content. Its analysis of overuse summarizes transparency data and ad hoc A/B analysis rather than establishing a universal controlled result: The performance effects of too much lazy loading.
Use high priority and preload only with evidence
If a genuinely critical image is discovered early in the HTML but is not prioritized appropriately, fetchpriority="high" may help. It shifts priority away from other resources, so use it sparingly. If an important image is hidden in CSS or JavaScript and therefore discovered late, first consider making it available earlier in the HTML. A preload can help when early discovery is not practical, but broad preloading competes with other critical resources.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
<img
src="/images/home-hero.webp"
width="1600"
height="900"
fetchpriority="high"
alt="The home page's featured landscape">
Do not combine lazy loading with an attempt to prioritize the same above-the-fold image. The loading behavior should reflect its actual location and importance.
5. Diagnose the LCP image before optimizing it
LCP measures the time from navigation until the largest image or text block in the viewport is rendered. When an image is the LCP element, separate its delay into three phases: resource load delay (how long before the request starts), resource load duration (how long transfer takes), and element render delay (how long after transfer before it is displayed). web.dev’s LCP guidance, published April 30, 2020 and updated March 31, 2025, describes a good experience as LCP at or below 2.5 seconds for at least 75% of page visits and values above 4 seconds as poor; check the current guidance when applying these thresholds.
| Observed bottleneck | What to investigate | Likely intervention |
|---|---|---|
| Long resource load delay | Is the image absent from initial HTML, hidden behind CSS or JavaScript, or incorrectly marked lazy? | Make it discoverable earlier; remove inappropriate lazy loading. Consider selective preload only if early discovery remains a problem. |
| Long resource load duration | Is the file oversized for its rendered slot, poorly compressed, or delivered in an inefficient format? | Reduce dimensions or bytes while preserving quality; use responsive candidates and test suitable formats. |
| Long element render delay | Has the image arrived but not appeared because of rendering, style, or layout work? | Investigate CSS and JavaScript work and layout dependencies. Further compression alone may not materially improve LCP. |
Measure the page before and after each change under comparable conditions. A smaller asset can shorten transfer without fixing late discovery or delayed rendering; optimizing the wrong phase can leave total LCP nearly unchanged.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.6. Decide whether an image CDN is worth the complexity
An image CDN can generate and deliver variants by size, density, format, and compression. web.dev reports that image CDNs can yield 40–80% image file-size savings in some cases; this is a broad source claim, not a result guaranteed for a particular site. It also says these services may outperform build-time scripts in many cases, not in every architecture. See web.dev’s image CDN guidance.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Consider a CDN when variants are hard to manage
A transformation service may be worth evaluating if the site has a large or changing image library, multiple display sizes, or several delivery formats that are difficult to generate and maintain at build time. Compare service cost, supported transformations, documentation, setup and migration effort, origin architecture, and cache behavior.
Prefer simpler processing when it fits
For a small site or stable image library, build-time optimization may be easier to understand and maintain. A separate CDN origin can add connection setup time; a service that proxies through the site’s main origin may avoid adding a separate origin connection. Test the actual architecture rather than assuming a CDN is automatically faster.
7. Troubleshoot common image-performance problems
- The hero image starts loading late: Check whether it is marked
loading="lazy", inserted only after JavaScript runs, or referenced solely from CSS. Make critical content available earlier and reserve preload for a diagnosed discovery problem. - The file is small but the page’s LCP barely changes: Check the LCP phases. If discovery or render delay dominates, changing compression does not address the cause.
- Mobile downloads are still large: Confirm that
srcsetincludes appropriately sized candidates and thatsizesmatches the actual CSS slot. Inspect the selected request on mobile. - The image looks blurry or has halos: Revisit the selected candidate dimensions and compression level. Inspect high-contrast text, sharp edges, transparency boundaries, and fine detail at the actual display size.
- Layout jumps when images appear: Add correct
widthandheightattributes and confirm CSS preserves the intended aspect ratio. - A format change increases downloads or causes cache surprises: Inspect the network requests, server content negotiation, fallback behavior, and cache key. When varying by
Accept, ensure caches distinguish the representations with the appropriateVarybehavior. - Lazy loading slows images users can see immediately: Remove lazy loading from initial-viewport images and apply it only to below-the-fold content.
- A new image CDN does not improve results: Compare the actual delivered bytes and timings, then account for connection setup, cache misses, transformation work, and migration overhead. Reconsider build-time processing if the workflow is simple.
Or skip the browser setup
If your goal is to capture a page as an image or PDF rather than optimize images served by your own site, ScreenshotNeo offers a one-request screenshot API. It is a different task from optimizing a website’s image delivery, but can avoid building browser-capture infrastructure.
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 parameters. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed; and its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Should I use AVIF or WebP?
Test both against representative images and your browser and publishing-tool support. Choose by delivered size and visual quality rather than format name alone.
Do I need a JavaScript library to lazy-load images?
For basic offscreen image loading, native loading="lazy" is generally sufficient. Keep it off above-the-fold and likely LCP images.
Will an image CDN always make a site faster?
No. Its value depends on image volume, transformation needs, cache behavior, origin setup, connection overhead, and cost.
Quick Recap
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.
Recommended Free Tools

