WebP optimization is more than converting a JPEG or PNG into a new file extension. The real workflow is: resize to the dimensions the layout actually needs, choose an acceptable WebP quality, generate responsive variants, reserve image dimensions, prioritize the likely LCP image, and lazy-load only images that are genuinely offscreen.
If you are looking for a single “best WebP quality setting,” there is no universal number. Photographs, screenshots, UI text, diagrams and gradients respond differently to compression, and encoder implementations do not map quality values identically across formats.
Dimensions: how many pixels the browser actually needs for the rendered slot.
Delivery: responsive sources, loading priority, caching/CDN behavior and when lazy loading is appropriate.
A practical workflow is:
resize → encode representative images → compare visual quality and bytes → generate responsive widths → deliver with srcset/sizes → prioritize LCP → lazy-load lower images → validate SEO and Core Web Vitals.
This guide is based on current WordPress media and responsive-image documentation, browser image-loading behavior, Core Web Vitals guidance, image-format characteristics, and implementation analysis. It is not a controlled Digital Bhatti WebP-vs-AVIF compression benchmark. File-size comparisons depend on the source image, encoder, dimensions, quality target, metadata, and implementation.
Last verified: September 26, 2026. WordPress media processing, browser support, image encoders, CDN features and Core Web Vitals behavior can change; verify current documentation before changing a production image pipeline.
Optimize Dimensions and WebP Quality Before Chasing a Newer Format
Start with the rendered dimensions, then encode WebP at the lowest quality that still preserves acceptable visual detail for that asset. Compare the result against AVIF or the original format only after dimensions and delivery are correct.
WebP Quality Settings: Use a Visual Threshold, Not a Magic Number
WebP quality settings are encoder-dependent and content-dependent. A setting that looks clean for a photograph can blur interface text or command-line screenshots.
| Image Type | What to Watch | Practical Approach |
|---|---|---|
| Photographs | Skin, gradients, fine texture, halos | Test several lossy settings and choose the smallest output that still looks acceptable at real display size. |
| UI screenshots | Small text, icons, 1px lines, color fringing | Use more conservative compression than for photos, or test lossless WebP when text clarity matters more than byte savings. |
| Terminal/code screenshots | Character readability and sharp edges | Preserve commands perfectly; do not optimize until text becomes harder to read. |
| Logos/flat graphics | Edge sharpness and transparency | Compare lossless WebP, PNG or SVG depending on whether the artwork is raster or vector. |
Rule: quality values are starting points for testing, not guarantees of equivalent visual quality across encoders or formats.
Lossy vs Lossless WebP
WebP supports both lossy and lossless compression.
- Lossy WebP: usually the first option to test for photographs and other continuous-tone images.
- Lossless WebP: worth testing for screenshots, graphics and transparency-heavy assets where lossy artifacts damage legibility.
Do not assume lossless is automatically smaller than PNG, or that lossy is automatically acceptable for technical screenshots. Compare real outputs at the final display size.
1. WebP vs AVIF: Quick Comparison
| Area | WebP | AVIF |
|---|---|---|
| Lossy compression | Supported | Supported |
| Lossless | Supported | Supported by compatible encoders/workflows |
| Transparency | Supported | Supported |
| Animation | Supported | Image sequences are supported by compatible implementations |
| Workflow maturity | Very widely integrated | Increasingly well supported in modern image pipelines |
| Encoding cost | Usually straightforward | Can require more encoding computation depending on encoder/settings |
| Practical choice | Strong general-purpose modern format | Worth testing when it produces a smaller acceptable result |
2. AVIF Is Not Automatically Better Than WebP
AVIF can provide excellent compression efficiency, particularly for some photographic assets, but no fixed percentage applies to every image.
The outcome depends on:
- Source image.
- Dimensions.
- Encoder implementation.
- Quality setting.
- Chroma settings.
- Metadata.
- Transparency.
- Image complexity.
A slightly larger WebP may be preferable when it preserves text, UI edges, gradients, or fine detail more cleanly.
3. Image Dimensions Often Matter More Than Format
Serving a 3000-pixel source image inside a 700-pixel article column can waste bandwidth regardless of file format.
Instead, generate useful intermediate widths such as:
- 480 px.
- 768 px.
- 1200 px.
- 1600 px only where the design genuinely needs it.
The exact sizes should follow your theme's actual rendered layout rather than a generic list copied from another website.
4. WordPress Already Supports Responsive Images
WordPress automatically generates multiple image sizes and can output responsive srcset and sizes attributes.
This lets the browser choose an appropriate source for the viewport and display density rather than downloading the same large image everywhere.
A simplified responsive image looks like:
<img
src="image-768.webp"
srcset="
image-480.webp 480w,
image-768.webp 768w,
image-1200.webp 1200w"
sizes="(max-width: 768px) 100vw, 768px"
width="1200"
height="675"
alt="Responsive image example">
Do not manually replace WordPress responsive markup unless you have a specific reason and understand the existing theme behavior.
5. Understand What sizes Actually Tells the Browser
srcset lists candidate image resources.
sizes tells the browser approximately how wide the image will be in the page layout.
If the sizes value incorrectly says an image is near the full viewport width when the actual content column is much narrower, the browser may choose an unnecessarily large source.
For custom WordPress themes, review whether the generated sizes values reflect the actual layout.
6. WordPress 7.1 Changes the Image-Processing Workflow
WordPress 7.1 introduced client-side media processing in supported browsers.
In supported Chromium environments, WordPress 7.1 can perform image work in the user's browser using a WebAssembly-based pipeline rather than requiring all image processing to happen on the server. The current WordPress developer note documents full support in Chromium-based browsers that satisfy the runtime checks, while Firefox and Safari fall back to server-side processing for the full pipeline because Document-Isolation-Policy support is not available there by default.
The 7.1 media pipeline can handle tasks including:
- Image resizing.
- Compression.
- Cropping.
- Sub-size generation.
- Format conversion.
- EXIF rotation.
- AVIF and WebP processing.
When the client-side path is unavailable, WordPress falls back to its server-side processing path. The full WASM pipeline currently depends on browser support for Document-Isolation-Policy/SharedArrayBuffer.
7. WordPress 7.1 Does Not Mean “Everything Is Automatically AVIF”
The presence of AVIF processing support does not mean every WordPress image should automatically become AVIF.
Your output still depends on:
- WordPress configuration.
- Theme behavior.
- Plugins.
- Image output filters.
- Browser/server processing path.
- CDN transformation rules.
Inspect actual frontend URLs and response formats rather than assuming what WordPress generated.
8. Use picture When You Need Explicit Format Alternatives
The picture element can provide several compatible sources while retaining a fallback image.
<picture>
<source srcset="hero.avif" type="image/avif">
<source srcset="hero.webp" type="image/webp">
<img
src="hero.jpg"
width="1200"
height="675"
alt="Example hero image">
</picture>
The browser chooses a compatible source rather than downloading every format listed.
9. Combine picture and Responsive Widths Only When Needed
A more advanced implementation can combine format choice and responsive sizing:
<picture>
<source
type="image/avif"
srcset="
photo-480.avif 480w,
photo-768.avif 768w,
photo-1200.avif 1200w"
sizes="(max-width: 768px) 100vw, 768px">
<source
type="image/webp"
srcset="
photo-480.webp 480w,
photo-768.webp 768w,
photo-1200.webp 1200w"
sizes="(max-width: 768px) 100vw, 768px">
<img
src="photo-768.jpg"
width="1200"
height="675"
alt="Responsive format example">
</picture>
This provides substantial control, but it also multiplies generated files. Use an automated media pipeline rather than manually maintaining every variant for a large site.
10. Treat the LCP Image Differently
If the article's featured or hero image is the Largest Contentful Paint element, it deserves higher loading priority than images farther down the page.
A strong LCP image should generally:
- Appear directly in HTML.
- Be discoverable early.
- Use appropriate dimensions.
- Use a reasonable file size.
- Not be delayed by unnecessary lazy loading.
A priority hint can be appropriate:
<img
src="hero.avif"
width="1200"
height="675"
fetchpriority="high"
decoding="async"
alt="Main article image">
Do not mark every image as high priority.
For the broader rules around preload, preconnect and fetchpriority, use the Resource Hints Optimization Guide. Keep this page focused on image-specific application.
11. Do Not Lazy-Load the Main LCP Image Blindly
Native lazy loading is valuable for many images below the initial viewport.
However:
loading="lazy"
should not be applied automatically to an above-the-fold image that is likely to become LCP.
12. Lazy-Load Images Farther Down the Article
A lower article image can use:
<img
src="diagram.webp"
width="1000"
height="600"
loading="lazy"
decoding="async"
alt="Technical diagram">
Lazy loading reduces unnecessary early image requests; it does not excuse oversized files.
13. Always Reserve Image Dimensions
Width and height attributes let the browser determine an intrinsic aspect ratio before the image finishes downloading.
<img
src="article.webp"
width="1200"
height="675"
alt="Article illustration">
Responsive CSS can still be used:
img {
max-width: 100%;
height: auto;
}
14. Width and Height Help CLS
When image dimensions are missing, surrounding content can move after the image loads.
This can contribute to Cumulative Layout Shift.
Pay particular attention to:
- Featured images.
- Article screenshots.
- Product screenshots.
- Thumbnails.
- Embedded graphics.
For complete LCP and CLS diagnosis, use the Core Web Vitals Optimization Guide.
15. JPEG Still Has Valid Uses
JPEG remains a legitimate format when:
- It already produces a small, acceptable result.
- A modern conversion does not meaningfully reduce bytes.
- Your production workflow requires a simple fallback.
- Compatibility constraints matter.
Do not replace an optimized JPEG with a larger WebP purely to obtain a modern file extension.
16. PNG Still Has Valid Uses
PNG remains useful for certain lossless graphics and transparency workflows.
However, large screenshots and interface images are worth testing against WebP or AVIF.
Use the version that maintains acceptable detail at a sensible file size.
17. SVG Is Often Better for Vector Artwork
Suitable uses include:
- Logos.
- Simple icons.
- Geometric illustrations.
- Simple diagrams.
SVG is not a replacement for photographic images.
Also treat untrusted SVG uploads carefully because SVG can contain active content depending on how it is handled.
18. Quality Numbers Are Not Comparable Across Formats
This comparison:
WebP quality: 75
AVIF quality: 45
does not establish that the two outputs have equivalent visual quality.
Judge the actual encoded images.
19. Compare Representative Image Types
Do not test only one stock photograph and apply the result to the entire site.
For Digital Bhatti, representative assets should include:
- Hosting screenshots.
- Control-panel screenshots.
- Terminal screenshots.
- WordPress UI images.
- Diagrams.
- Featured photographs.
Different content types can favor different encoding settings.
Use this table when Digital Bhatti performs its own WebP/AVIF comparison. Leave cells blank until the exact asset, encoder and output have been tested. Do not turn documentation-based estimates into measured results.
| Asset type | Source dimensions | Displayed dimensions | Original format / bytes | WebP encoder / setting / bytes | AVIF encoder / setting / bytes | Visual-quality observation | Chosen format / reason |
|---|---|---|---|---|---|---|---|
| Hosting / control-panel screenshot | |||||||
| Terminal / code screenshot | |||||||
| WordPress UI screenshot | |||||||
| Featured / photographic image |
20. Remove Unnecessary Metadata
Public images may contain:
- EXIF information.
- Camera model data.
- GPS coordinates.
- Editing metadata.
- Embedded thumbnails.
If the information is not required, removing it can reduce file size and prevent accidental publication of metadata such as location information.
21. WordPress Generates Intermediate Image Sizes
WordPress creates image sub-sizes according to core, theme, and plugin registrations.
Review whether your installation generates:
- Useful frontend sizes.
- Duplicate dimensions.
- Plugin-specific thumbnails that are no longer used.
- Very large variants never displayed.
Too few useful sizes can cause oversized delivery, while an excessive number of unused variants can increase storage and processing overhead.
22. Do Not Disable Responsive WordPress Images Without a Reason
WordPress's responsive-image system is useful because the browser can select an appropriate resource based on viewport and display characteristics.
If a performance plugin or custom theme strips srcset or replaces it with a single full-size image, verify whether mobile visitors are being forced to download unnecessarily large assets.
23. WordPress Image Plugins Need an Architecture Review
Before activating another image-optimization tool, identify what already handles:
- Compression.
- WebP generation.
- AVIF generation.
- Lazy loading.
- Responsive images.
- CDN delivery.
A plugin may:
- Create local derivatives.
- Use a remote optimization service.
- Rewrite HTML.
- Use request negotiation.
- Transform images at an edge CDN.
Know which system owns each task.
WordPress Image Plugin Decision Rule
Before installing another image plugin, identify what WordPress core, the host and the CDN already do.
| Need | Possible Owner | Risk If Duplicated |
|---|---|---|
| Compression/format generation | WordPress, image plugin, host or CDN | Multiple derivative sets and inconsistent quality |
| Lazy loading | WordPress/theme/performance plugin | Duplicate attributes or delayed LCP image |
| Responsive markup | WordPress/theme/CDN rewrite | Broken srcset/sizes and oversized downloads |
| CDN transformation | Image CDN or hosting platform | URL rewriting conflicts and cache fragmentation |
24. Avoid Stacking Image Optimization Systems
A WordPress site can accidentally have several overlapping layers:
- WordPress core media processing.
- A performance plugin.
- A dedicated image plugin.
- A CDN image service.
- Hosting-provider optimization.
This can produce:
- Duplicate WebP/AVIF files.
- Conflicting lazy-load markup.
- Broken rewritten URLs.
- Cache fragmentation.
- Unnecessary storage use.
Prefer one coherent image pipeline.
25. Featured Images Need Special WordPress Testing
On many WordPress article templates, the featured image becomes the LCP element.
A poor implementation may create:
HTML
↓
JavaScript initializes
↓
Image URL is injected
↓
Browser discovers image
↓
Download starts
Where possible, important hero images should be discoverable directly from server-rendered HTML.
26. Image CDN vs Normal CDN
A conventional CDN primarily caches files closer to visitors.
An image CDN may additionally:
- Resize images.
- Convert formats.
- Change quality.
- Generate device-specific variants.
Evaluate image-CDN services according to:
- Cost.
- URL stability.
- Cache behavior.
- Vendor dependency.
- Format control.
- Image quality.
For cache freshness, revalidation and repeat-load behavior, use the Browser Caching, Cache-Control & ETag Guide. For HTTP content compression, use the Brotli & Gzip Compression Guide; JPEG, WebP and AVIF are already compressed image formats and should not be treated like HTML, CSS or JavaScript for expected HTTP-compression gains.
27. CSS Resizing Does Not Reduce Download Bytes
This:
<img
src="4000x3000-photo.jpg"
style="width:700px;">
can still force the browser to download the large source file.
Use appropriately sized source files or responsive variants instead.
28. Preload the LCP Image Only When It Solves a Discovery Problem
An image preload can be appropriate when an important image is otherwise discovered too late.
<link
rel="preload"
as="image"
href="/images/hero.avif">
For a responsive LCP image, preload can use the same candidate logic instead of forcing one oversized source:
<link
rel="preload"
as="image"
href="hero-768.webp"
imagesrcset="hero-480.webp 480w, hero-768.webp 768w, hero-1200.webp 1200w"
imagesizes="(max-width: 768px) 100vw, 768px">
Do not preload every thumbnail, gallery image, or carousel slide.
If the image is already discovered very early and assigned suitable priority, another preload may provide little benefit.
If LCP remains slow after the image itself is correctly sized and delivered, return to the Core Web Vitals Optimization Guide to separate document response, resource discovery, load duration and render delay instead of repeatedly recompressing the same image.
29. WebP and AVIF Do Not Directly Guarantee SEO Rankings
Do not frame image conversion as:
“Switch to AVIF and rank higher.”
Image optimization can improve:
- Transfer size.
- Loading behavior.
- LCP when images are the bottleneck.
- User experience.
Organic search performance still depends on content usefulness, relevance, indexing, site architecture, competition, links, and many other systems.
30. Image SEO: Help Google Discover and Understand the Image
Google's current image SEO guidance emphasizes discoverability, HTML image elements, surrounding context, descriptive filenames and alt text rather than image-format tricks.
- Embed important images with standard HTML
<img>elements; Google does not index CSS background images in the same way. - Place images near relevant text on pages that are relevant to the image subject.
- Use short, descriptive filenames where practical.
- Write useful alt text that describes the image in context and supports accessibility.
- Avoid keyword stuffing in filenames or alt attributes.
- Keep image URLs crawlable.
For large sites or images that are difficult for crawlers to discover—such as assets surfaced primarily through JavaScript—Google documents image sitemaps as a way to expose additional image URLs. Current Google documentation requires the image location and has removed older optional image-sitemap tags such as caption, title, geo location and license from the documented extension.
31. Original Images Can Strengthen Digital Bhatti More Than Stock Images
For technical articles, prioritize original visual evidence such as:
- Hosting dashboards.
- WordPress admin screenshots.
- Server configuration screenshots.
- Terminal output.
- PageSpeed screenshots.
- Before/after image file tables.
- Original architecture diagrams.
This improves the usefulness and evidentiary value of the article independently of whether the image happens to be WebP or AVIF.
32. Image Optimization and Render Blocking Are Separate Problems
A tiny AVIF image can still display late if:
- CSS delays rendering.
- JavaScript injects the image late.
- The image URL is discovered late.
- The HTML document arrives late.
Use the Render-Blocking Resources Guide when CSS, JavaScript or fonts are responsible.
33. TTFB Is a Separate Stage
The browser cannot discover normal HTML image references until the page response begins arriving.
If document delivery is late, even a small AVIF may begin downloading later than expected.
Use the TTFB & Server Response Time Guide for backend diagnosis.
34. Blogger-Specific Image Optimization
Blogger can generate and serve transformed image URLs through Google's image infrastructure, so optimize what you can verify in the final rendered page rather than assuming the original upload size is always the delivered size.
- Inspect the actual image URL and rendered dimensions in DevTools.
- Check whether the displayed image is much smaller than the delivered resource.
- Keep width and height attributes or a stable aspect ratio to reduce layout movement.
- Avoid replacing Blogger-managed image delivery with a custom pipeline unless there is a measured reason.
- Use original Digital Bhatti screenshots, diagrams and evidence where possible instead of generic stock imagery.
35. Resizing and Compression Solve Different Problems
Resizing reduces pixel dimensions. Compression reduces the encoded byte cost of those pixels.
If a 4000×3000 photo is displayed at 800×600, compressing the original may still leave unnecessary pixels in the download. Resize first to useful responsive widths, then encode each derivative at an acceptable quality.
36. Image Optimization Workflow
Audit Rendered Dimensions
↓
Identify Oversized Images
↓
Identify LCP Image
↓
Generate Responsive Sizes
↓
Compare WebP / AVIF / Existing Format
↓
Choose Acceptable Quality
↓
Add Width & Height
↓
Prioritize LCP Image
↓
Lazy-Load Lower Images
↓
Retest LCP / CLS
↓
Monitor Field Data
37. Practical WebP vs AVIF Decision Matrix
| Situation | Recommended Approach |
|---|---|
| AVIF clearly smaller at comparable visual quality | Use AVIF where the delivery pipeline supports it reliably |
| WebP looks better at a similar file size | Use WebP |
| Existing JPEG already very small and clean | Conversion may provide little practical benefit |
| Simple vector logo or icon | Consider SVG |
| WordPress site with large image library | Use a coherent automated responsive-image pipeline |
38. Common WordPress Image Optimization Mistakes
- Converting without resizing: oversized dimensions remain oversized.
- Assuming AVIF always wins: real encoded results differ.
- Lazy-loading the LCP image: can delay the most important image.
- Missing dimensions: can contribute to layout movement.
- Ignoring srcset: mobile users may receive unnecessarily large resources.
- Incorrect sizes: the browser may choose a larger candidate than necessary.
- Using several optimization plugins: transformations can conflict.
- Preloading many images: important resources compete with each other.
- Destroying screenshot quality: tiny files are not useful when commands or interface text become unreadable.
- Using CSS-only resizing: the browser may still download the huge source.
39. Image Performance Specialist Map
| Observed Problem | Primary Owner | This Page Owns |
|---|---|---|
| Image bytes/dimensions are too large | Image Optimization | Format, quality, responsive sizes and image pipeline. |
| Likely LCP image starts too late | Core Web Vitals / Resource Hints | Correct image markup, dimensions and lazy-loading behavior. |
| Image causes layout movement | Core Web Vitals | Intrinsic dimensions and stable aspect ratio. |
| Image repeats download on later visits | Browser Caching | Asset versioning and image-delivery choices. |
| CSS/JS delays image rendering | Render-Blocking Resources | Image-specific delivery once the broader critical path is fixed. |
40. Prevent Image-Performance Regressions
Image performance can regress when content teams upload larger screenshots, themes change card dimensions, new hero layouts are introduced, or plugins/CDNs alter generated variants.
Track representative image weight, delivered dimensions, number of early image requests and whether the likely LCP image remains discoverable without unnecessary lazy loading. Use the Web Performance Budgets & Regression Monitoring Guide for ongoing guardrails.
41. WebP vs AVIF Optimization Checklist
- Check rendered dimensions before changing formats.
- Test WebP quality on representative photographs, screenshots and diagrams.
- Separate resizing from compression.
- Do not assume AVIF is always smaller or better.
- Compare real image quality and final byte size.
- Use responsive image variants.
- Keep WordPress-generated
srcsetunless there is a justified alternative. - Check that
sizesreflects the actual layout. - Understand the WordPress 7.1 media-processing path and current Chromium/server-fallback behavior.
- Use
picturewhen explicit format alternatives are required. - Treat the LCP image separately.
- Do not lazy-load the main above-the-fold image blindly.
- Lazy-load suitable below-the-fold images.
- Provide width and height.
- Use SVG for suitable vector graphics.
- Inspect screenshot readability after compression.
- Remove unnecessary metadata where appropriate.
- Avoid overlapping image-optimization systems.
- Use preload only when it solves a real discovery problem.
- Do not describe WebP or AVIF as ranking guarantees.
- Measure LCP and CLS after deployment.
Optimize the Delivered Image, Not Just the Source File
Check the image the browser actually downloads: its dimensions, format, byte size, discovery timing, loading mode and reserved layout space. A modern extension alone does not guarantee an efficient image.
Frequently Asked Questions
What WebP quality setting should I use?
There is no universal best number. Test representative images at the dimensions they will actually be served, then choose the lowest WebP quality that preserves acceptable visual detail. Screenshots and small text usually need more conservative compression than photographs.
Is lossless WebP better for screenshots?
Sometimes. Lossless WebP is worth testing when UI text, terminal commands or sharp edges suffer visible artifacts under lossy compression. Compare it with PNG and higher-quality lossy WebP rather than assuming one format always wins.
Does WebP help image SEO?
WebP itself does not create an SEO advantage. Google focuses on image discoverability, useful page context, descriptive filenames and alt text, crawlable image URLs and strong landing pages.
Is AVIF always better than WebP?
No. AVIF can be more efficient for some images, but visual quality, file size, encoder settings and workflow compatibility determine the better result.
Should I convert every WordPress image to AVIF?
No. Test representative screenshots, photographs and graphics first. Use a consistent automated pipeline only after confirming the results are acceptable.
Does WordPress support WebP?
Yes. WordPress has supported WebP uploads since WordPress 5.8, and modern WordPress versions include broader media-processing capabilities.
Does WordPress support AVIF?
Yes. Modern WordPress supports AVIF-related image handling, and WordPress 7.1 expanded the media-processing pipeline with client-side AVIF processing in supported environments.
What changed for images in WordPress 7.1?
WordPress 7.1 introduced client-side media processing in supported browsers. It can perform tasks such as resizing, compression, sub-size generation and format conversion in the browser, while unsupported environments fall back to server-side processing.
Should I manually add srcset in WordPress?
Usually not. WordPress automatically generates responsive-image markup for compatible Media Library images. Custom markup is more appropriate when the theme or application needs behavior different from the standard output.
Should featured images use lazy loading?
If the featured image appears above the fold and becomes the LCP element, delaying it with lazy loading can hurt LCP. Lower-page images are usually better lazy-loading candidates.
Does WebP improve Google rankings?
WebP itself is not a ranking guarantee. Efficient image delivery can improve user experience and performance when images are a bottleneck, but search visibility depends on many additional factors.
Do width and height attributes prevent responsive images?
No. They establish intrinsic dimensions and aspect ratio. CSS can still make the image fluid with max-width:100% and height:auto.
Should I use an image CDN?
An image CDN can be useful for large sites that benefit from automatic resizing, conversion and distributed delivery, but evaluate cost, URL stability, quality controls and vendor dependency first.
Abdul Shakoor
Founder of Digital Bhatti, focused on web hosting and infrastructure, WordPress performance, Linux VPS environments, web servers and technical SEO.