Connect with us


Optimizing images for your Magento store: Best practices, tips & tricks

Image: SEMRush

When it comes to optimizing your Magento store, image optimization is a must. Often times high-quality images are used extensively in order to engage potential customers and incentivize a purchase. That being said, when those images are not optimized, they can cause a Magento store to become delayed and undesirable for the user’s experience.

How can you optimize your store’s images to help improve speed without sacrificing the quality of your images? There are several different ways to access the Magento image compression settings. One way is by running commands through the root folder. Another way is with the help of a Magento image optimization extension. With both methods, you can reduce image file sizes to help optimize your store’s performance. When your store is up to speed, you’ll have more orders placed.

Why You Should Optimize Images?

Images are the main things that take up time to load on your server. Especially if you have a lot of images hosted on your store, it can be timely to reduce image sizes one by one. This is where the help of an extension comes into play.

An image compression extension for Magento 1 or 2 is one of the best ways to increase speed and improve performance. The following is an overview of the benefits you afford when utilizing an image compressor for your online store:

  • Improved Google PageSpeed Insights ratings
  • Enhanced user experience due to improved speed
  • A potential increase in orders placed through your store
  • Compressed Magento images without loss of image quality
  • Images become SEO-friendly, overall benefitting your store’s SEO

What makes image optimization so essential are the potential customers that will go to your site. If you have a store that loads slowly, you’re missing out on almost half of your clients because they will simply leave due to their impatience. You will have a higher customer conversion rate and offer a better user experience with the use of an image compression module.

Magento Image Compression Via Commands

To get started, you need to connect to your server via Secure Shell (SSH). Install the following utilities in order to optimize .jpeg and .png files. Fire these commands one at a time in order to install them:

  • JPEG
    apt-get install jpegoptim
  • PNG
    apt-get install optipng

Optimize Media in the Catalog Folder

Execute the following two commands after installing the utilities to optimize images:

  • (in the catalog folder)
    cd catalog
    find -type f -name “*.jpg” -exec jpegoptim –strip-all{} \;
  • (in the media folder)
    cd catalog
    find catalog/ -iname *.png -print0 |xargs -0 optipng -o7

After executing each command, make sure to wait a little bit of time for the command to take action and the changes to occur. This is a quick trick you can implement if you have experience with running commands and are confident that you are able to.

Is There an Easier Way to Compress Images on Magento?

While running these commands may be simple for some, others may find it more beneficial to use a Magento extension if they aren’t comfortable with running commands. Not all Magento store owners are familiar with accessing the Secure Shell and they may risk errors occurring on their store if they do something incorrectly. The great thing about using an image optimization extension is that it’s actually very easy to do when you choose the right one. Let’s check how you can process your graphics using one of the numerous modules on the market by Amasty.

Once you have the extension downloaded and installed on your Magento store, you can enable image compression through the Magento settings.

  1. First, you need to locate the image compression module.
  2. Choose to configure your store’s image compression by the image extension (png, jpeg, gif)
  3. You should notice that the module has automatically compressed these images without losing the quality of your images.
  4. For images located in the media and skin directories, then you should use the command line interface (CLI) in order to compress those images as well.

More Settings and Tips to Optimize Your Store

With Image Optimization, you can access other settings in order to further optimize your store. Make sure to implement the following tricks:

  • CSS and JavaScript Minification
    Minifying CSS and JS codes are done by removing unnecessary lines, white spaces, comments, and any other unnecessary characters. This can be enabled through the CSS & JS minification settings module.
  • CSS & JS Timestamped File URLs

Clear your website’s page cache every time there are changes to your CSS and JS files. This will ensure that web users have access to your updated content.

  • Relocate JavaScript to the Footer

Speed can easily be increased by simply relocating JavaScript files to the footer. Image Optimization automatically takes care of this.

Further Optimizing Your Magento Store

Remember, there is more to optimizing your Magento store than compressing images. While it does help a lot, there are other practices you should incorporate as well. These include:

  • Keeping your Magento up to date with updates to the latest version
  • Integration with a Content Delivery Network – CDN
  • Caching your store
  • Merging CSS and JS files
  • Removing unnecessary modules and extensions
  • Configuring MySQL
  • Keeping indexes updated
  • Switching your host if they are not meeting speed requirements

Have any other tips or tricks we may have missed? Let us know down below in the comments. 

Editors’ Recommendations:

Chris has been blogging since the early days of the internet. He primarily focuses on topics related to tech, business, marketing, and pretty much anything else that revolves around tech. When he's not writing, you can find him noodling around on a guitar or cooking up a mean storm for friends and family.

Click to comment

You must be logged in to post a comment Login

Leave a Reply

More in Business