Shopify Image Optimization: Compression, SEO, and Best Practices
It's well-known among web designers that keeping image file sizes small is crucial for fast website loading times. This prevents users from leaving the site and also offers SEO advantages. However, you might be surprised to learn that if you're spending time compressing images before uploading them to a Shopify store, it's not necessary.
I used to manually compress and resize images, even when clients didn't specifically request or pay for these tasks, to ensure their sites performed optimally. But it turns out this practice may be unnecessary.
Does Shopify Handle Image Compression?
Yes, Shopify automatically compresses images when they are displayed on an online store, which helps in reducing file sizes for quicker page loads. It’s best to upload high-quality images, as pre-upload compression can sometimes degrade the image quality. Shopify compresses images by converting them to the WebP format, which is designed for web use and supports both lossy and lossless compression. This format provides smaller file sizes than JPG and PNG while maintaining comparable quality. Even GIFs are converted to animated WebP format. Shopify detects the browser’s supported file types, so if WebP isn't supported, an alternative format is delivered.
Note that Shopify’s automatic optimization works if the theme uses the
image_url
andimage_tag
Liquid filters. Older themes from before 2022 might not use these filters, so it’s a good idea to keep your theme updated to leverage Shopify’s full range of features.
Image Optimization for SEO on Shopify
Instead of focusing on resizing images, there are other effective ways to optimize images for SEO:
- Use Descriptive File Names
Search engines use image file names to understand and rank content. Rename image files with descriptive, relevant names that potential customers might use when searching for your products. For instance, instead of using a default camera name, rename the file to reflect the product accurately.
You can rename files before uploading them to Shopify or modify them in Shopify Admin under Content > Files > Select the image > Enter a new name > Save.
- Add Alt Text to Images
Alt text (alternative text) describes the content of an image and serves multiple purposes: it provides a backup if the image fails to load, enhances accessibility, and boosts SEO. Accurate and descriptive alt text can help your images appear in Google image searches and contribute to better visibility in search results.
Keep alt text under 125 characters and ensure it’s descriptive, including details like colors, model names, and version numbers without keyword stuffing. You can add or edit alt text in Shopify Admin under Content > Files > Select the image > Enter alt text > Save.
Resizing Images for Shopify
For a polished and consistent look, it’s important to ensure all product images have the same aspect ratio. I recommend using square (1:1) images, as they fit well on both desktop and mobile screens. Portrait images are a good second choice for grid layouts, while landscape images can be problematic as they tend to appear smaller. Use Shopify’s image editor for cropping as needed.
Ensure that collection page grid items and product page thumbnails maintain consistent aspect ratios to avoid image cropping or inconsistencies. This uniformity enhances the visual appeal and professionalism of your site.
Recommended Image Sizes for Shopify
While Shopify handles large image files by compressing them automatically, it’s crucial to upload images of sufficient size to ensure clarity across different devices.
Here are some general guidelines for image dimensions:
- Full-width images: 2000 x 2000px
- Hero images (where high quality is essential): 4000 x 4000px
- Content images (e.g., product images taking up half the screen width): 1000 x 1000px*
*If your theme includes a magnify feature on product pages, stick to full-width dimensions to capture detailed views.
Avoid uploading excessively large images for users with high-resolution monitors. Check your store’s analytics to understand your visitors’ most common devices and adjust your image sizes accordingly.
Additional Image Optimization Tips
- Avoid adding text to slideshow or background images; instead, use the theme’s text options. Real text is better for SEO.
- Use mobile-specific images if necessary, with different versions optimized for desktop and mobile views.
- Don’t apply alt attributes to purely decorative images to avoid potential SEO penalties.
- Set an image “focal point” if the background image is cut off, ensuring the key part of the image remains visible on all screen sizes.
Although image optimization might not be the most exciting part of web design, it is essential for enhancing website performance and user experience.