Identifying resources which are not critical on initial page load and loading them only when necessary is known as lazy loading. It is a method for cutting the essential rendering path’s length, which results in faster page loads.

Although it can happen at any time while using the application, lazy loading frequently happens when users scroll or navigate.

Lazy loading of images is possible in HTML5 by combining the img> tag with the lazy property. By delaying the loading of images until they are required, typically when they enter the user’s viewport, lazy loading is a strategy.

An img> tag with the lazy property instructs the browser not to load the picture right away when the page loads. Instead, the browser will hold off until just before the image appears on the screen, usually when it comes into view of the user.

Lazy Loading of Images in HTML

Here’s an example of how to use the lazy attribute on an image tag:

<img src="prowebguru.jpg" data-src="proimage.jpg" alt="Lazy loaded Image" loading="lazy">

In this example, the src attribute is set to a placeholder image (prowebguru.jpg). The actual image source is specified using the data-src attribute, which points to the desired image file (proimage.jpg).

The image should be loaded slowly because the loading attribute is set to “lazy”. This property tells the browser to hold off on loading the picture until the user can see it.

Here is a way to Add Custom Image In Jetpack Lazy Load.

You may speed up the loading of photos on your website by utilizing the lazy property, especially if you have a lot of images or large images that could slow down the first page load. By speeding up initial loading, it enhances page performance and user experience overall.

Check this to know more about Lazy Loading.