Has anyone tested how WEBP improves the visual appeal of a design?
How can WEBP image files enhance the visual appeal of a design?
-
-
- Gerade eben
- Anzeige
Hallo!
Wenn du gerade an deiner Website arbeitest oder dein aktuelles Hosting überdenkst: Wir betreiben mit NetzLiving eine Hosting-Plattform, die speziell auf Performance, Sicherheit und einfache Verwaltung ausgelegt ist.
- ✔️ Schnelle Ladezeiten (optimiert für WordPress & Co.)
- ✔️ Deutsche Server & DSGVO-konform
- ✔️ Persönlicher Support (kein 0815-Ticket-System)
-
I don't think that webp-format pictures look different then jpg or png formats. However, they are significantly smaller in file size, which gives you a dramandious speed boost when loading your page.
Neverthelss, make sure you have a fallback jpg in place. Also lazy loading of higher resolution images is a nice way to increase your performance.
I am currently developing this page here: https://www.garden-shop.at/ . Take a look at how the large image in the background of the hero section is been loaded and smoothly exchanged only after its loading has been finished. Here is the function that I am using:Code
Alles anzeigendocument.addEventListener("DOMContentLoaded", function () { const lazyloadElements = document.querySelectorAll(".lazyload"); lazyloadElements.forEach((el) => { const highResImage = el.getAttribute("data-bg"); if (highResImage) { // Preload the high-quality image const img = new Image(); img.src = highResImage; console.log("start preload: ", highResImage); img.onload = function () { console.log("finished preload: ", highResImage); // Set the high-quality image to the ::before pseudo-element el.style.setProperty("--bg-image-high-res", `url('${highResImage}')`); // Add a class to trigger the fade-in effect el.classList.add("loaded"); }; } }); });
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!