Optimizing Images for Magento 2 – Finding Ways


Magento 2, like any other eCommerce platform, is all about visuals. Product images, icons, sales banners, and all of the other pictures you add to your blog and other pages.

Not only do they help to make your store more engaging and attractive, but improve your sales potential. You won’t be able to sell any products without colorful and high-quality images describing those products.

But there is one downside: as you add more images to your store, it gets heavier, and it takes longer for the system to load them correspondingly.

You can use custom Magento 2 extensions to optimize your store’s loading speed. Or deal with it yourself. Read about it further:

Is it difficult to optimize photos for your store, and how to do it?


Optimizing images is one of the general steps you need to take towards a flawless website. You should not only use modern file formats but lazy load and vector images, etc.

Let’s summarize the steps you need to follow for Magento image optimization.

Use a CDN


Using content delivery networks (CDN) is probably the easiest way to optimize images. This is done automatically and does not require your active participation.

A group of servers around the world ensures fast delivery of content – this is what is called a content delivery network. Thanks to this, your clients will not wait for the image to be downloaded from a remote server. CDN uses the server most dressed for the user.

There are even smart CDNs that have room for customization. They could detect users’ locations and rescale and optimize images in real time.

Resize and compress images

Uncompressed JPG, GIF, and PNG images take a lot of time to load 一 if the images are big, so will be the amount of overhead on the website. Correspondingly the bigger the images, the more they will benefit from the compression and resizing.

Did you know the images’ quality directly affects the purchase decision on your site? We think so, you know that. Therefore, you cannot allow significant loss of picture quality. Use special programs or online web services to compress images without changing its quality.

You can also use Ps (Photoshop) or other similar programs for 82% lossy image compression. This will not affect the image quality.

On the other hand, resizing means reducing the number of pixels in the image, the resolution of the image. If the number of pixels is too small, resizing can dramatically affect image quality.

Therefore, you should be careful when using this image enhancement method.

Use modern file formats


Online stores usually use JPEG for photos and complex illustrations, while PNG and SVG are used for logos and simple illustrations. However, those formats are bulky and take some time to load, especially if you don’t use CND we’ve mentioned before.

WebP is the modern file format that becomes increasingly popular across multiple websites. It is a file format developed by Google that offers you a smaller size than JPEG and PNG, with no significant quality loss.

Unfortunately, Magento doesn’t support this format by default. So you can’t upload images in WebP directly to the platform. But you can use multiple WebP converter extensions.

Use lazy load


Lazy loading or deferred image loading is another trick you can use to optimize images for your Magento system. It allows you to defer the loading of images that are beyond the viewer’s viewport.

In other words, image loading is delayed until the user scrolls to the part of the page where those images are placed.

It significantly improves page loading since the users won’t have to wait for all page elements to load completely. Lazy loading affects the website performance as well, especially for users with slow mobile networks.

But note that you shouldn’t use lazy loading for the elements above the fold. It could negatively influence the LCP score.

Use vector images

If you examine your website images you’ll notice that some of them could be easily replaced with vectors. Why so? Vector images don’t consist of pixels, so you won’t see any blurry edges when you zoom in.

The image will remain the same quality and size even if you choose to resize the image as big as you want. That’s why it is recommended to use vector images instead of raster ones.

Enable Fastly optimization

Except for the other approaches to image optimization, Magento also offers you a built-in tool for the automatic optimization of images 一 Fastly. It crops, resizes, and adjusts the ratio format with little to no human interference.

Since optimizing images in Magento manually is tiresome, Adobe recommends you use Fastly. Besides, it supports JPEG, PNG, WebP, and GIF formats.

All you need is to enable, configure, and verify Fastly afterward. The settings are quite flexible: you can specify the extent of quality loss during compression, tweak the resize filters, and more.

Replace images with icons and fonts

It’s the harsh truth, but your customers won’t care about your images if they can’t load your website fast enough. So there is a fine line between having enough images and too many images. Accordingly, if possible, you should replace unnecessary images with icons and fonts.

Use real text instead of images. Sometimes the sites add images with text. This makes them harder and less searchable.

Does the acceleration of the site depend on the improvement of pictures?

As you can see, there are many steps you need to take to improve the quality of the images on your online store. But the good news is that you don’t need to buy an expensive extension cord. Basically, optimization methods require you to configure several parameters in Magento and do not advise using unnecessary images.

With the right approach and attention to even the smallest details, you’ll be able to optimize images and maintain desirable website performance. Technologies are changing, it is necessary to constantly study new trends and keep abreast of new developments.

Ricardo is a freelance writer specialized in politics. He is with from the beginning and helps it grow. Email: richardorland4[at]