Interactive agency + Marketing agency = Two Colours

How to optimize images on a websiteTo improve SEO and performance? Compression, alternative texts and other methods 

How to optimize images on a website to improve SEO and performance? Compression, alternative texts and other methods 
AI
I.R.I.S.
I.R.I.S.
AUDIO VERSION: How to optimize images on a website to improve SEO and performance? Compression, alternative texts and other methods 
1x
00:00
00:00
Did you know that all images, photos and graphics can significantly affect the loading speed of your website, and thus your position in search results? In this article, you'll learn why image optimization is so important, how to effectively compress graphics without losing quality, what tools and plugins to use for optimization, and how to write effective alternative texts (a.k.a. alt tags). With these tips, your site will become faster, more responsive and user and search engine friendly. Ready to improve your site's SEO and performance? 
Spis treści

Why is graphic optimization important?

Graphics optimization is one of the most important elements in maintaining a website's performance and improving its visibility in search results. Its neglect can lead to serious problems, as today's users expect fast page loading and an excellent experience. Let's take a closer look at why image optimization is so important, especially from the perspective of page loading speed and SEO.

Impact of graphics optimization on page load speed

The loading speed of a website has a very strong impact on the user experience (user experience). Studies show that users expect a page to load within seconds. If a page takes too long to load, they may become discouraged and leave the site before they even see the content. This phenomenon is called "bounce rate" (rejection rate) and can negatively affect your site. 

You can read more about website speed optimization here: Website loading speed - Control and optimization methods for effective SEO and higher conversions

Images are often one of the biggest "culprits" of slow loading pages. Large, non-optimized image files can significantly increase load times because the browser must download and display these files before the page fully loads. This means that the more images and the larger the files, the longer users have to wait.

Optimizing photos involves reducing their size while maintaining good quality. This can be achieved by compressing the images, changing their format to a more efficient one, and adjusting the dimensions of the images to the actual needs of the site. This makes the images load faster and makes the entire site more responsive.

optimization of graphics for the website

The importance of optimizing graphics for SEO

SEO (Search Engine Optimization) is the process of optimizing a website to achieve the best possible position in search results. Search engines, such as Google, consider many factors when evaluating a page, and loading speed is one of them.

Faster sites are favored by search engines because they provide a better user experience. If your site loads quickly, it increases the likelihood that users will stay on your site longer, browse more content and may eventually take a desired action, such as buying a product or signing up for a newsletter. As a result, search engines will be more likely to rank your site higher in search results.

Optimizing images for a page also affects other aspects of SEO. For example, Adding relevant alternative text (tags or alt attributes) to graphics helps search engines understand what the image represents, which can improve the relevance of search results. Alt attributes are also important for accessibility, helping users using screen readers understand the content of graphics.

Another element is responsive images. Nowadays, users browse websites on a variety of devices - from desktops to tablets to smartphones. Images that are adapted to different screen resolutions provide a better user experience and can contribute to higher ranking in search results.

Learn more about SEO and SEO optimization in our article: What is SEO and what is effective SEO?


Reduce the size of images on your website

Adjusting the dimensions of the images to the actual needs of the site and using responsive techniques not only helps improve the performance of the site, but also provides a better user experience on different devices. 

How to customize the dimensions of the images according to the requirements of the page

High-resolution images that are displayed in small sizes waste resources and slow down page loading. Here are some steps on how to adjust the dimensions of images:

  1. Determination of size requirements: Before adding a graphic to your website, consider where it will be displayed and its actual dimensions. For example, if the image will be displayed in a gallery that is 800 pixels wide, it doesn't make sense to upload an image that is 4000 pixels wide.
  2. Using the right tools to resize: Programs such as Adobe Photoshop, GIMP or online tools such as Canva and PicResize allow you to easily resize images. Just open it in the program of your choice, enter the new dimensions and save the file.
  3. Maintaining the aspect ratio: When resizing a graphic, it is important to maintain its aspect ratio to avoid distortion. Most resizing tools offer an option to maintain the aspect ratio of the image, making the process easier.
  4. Compression after resizing: After adjusting the dimensions, it is a good idea to compress the image to further reduce its size.
image formats for the website

Image compression

Graphics compression is the process of reducing the size of image files while keeping their quality at an acceptable level. This makes images load faster, resulting in better website performance and higher ranking in search results. 

Differences between image formats (JPEG, PNG, GIF, WebP AVIF).

JPEG (Joint Photographic Experts Group).

JPEG is one of the most popular image formats used on the Internet. This format uses lossy compression, which means that a certain amount of image data is removed to reduce its size. JPEG is ideal for photos and images with a large number of colors, where a slight loss of quality is acceptable. JPEG compression can be adjusted, allowing you to find a balance between quality and file size.

PNG (Portable Network Graphics)

PNG is a lossless format, which means it retains full image quality, but typically generates larger files compared to JPEG. PNG supports transparency, making it an ideal choice for graphics with transparent backgrounds, such as logos or icons. Although PNG is larger, PNG compression is useful for graphics that require high quality and transparency.

GIF (Graphics Interchange Format)

GIF is a format used mainly for simple graphics and animations. GIF supports only 256 colors, making it less suitable for photos and more complex images. Its biggest advantage is its ability to create animations, which makes it popular for websites.

WebP

WebP is a modern image format developed by Google that offers both lossy and lossless compression. WebP can reduce the size of images by 25-34% compared to JPEG while maintaining similar quality. It also supports transparency (like PNG) and animation (like GIF), making it a very versatile format. WebP is gaining popularity due to its compression efficiency and support by modern browsers.

AVIF (AV1 Image File Format) 

The AVIF format is particularly recommended because of its ability to maintain high image quality while significantly reducing file size, making it extremely efficient. AVIF is a format based on AV1 compression technology, which offers both lossy and lossless compression. Compared to other formats such as JPEG or WebP, AVIF can achieve smaller file sizes while maintaining comparable or better image quality. AVIF supports wide dynamic range (HDR), which makes images look more realistic and lifelike. In addition, its support by browsers and graphics tools is growing rapidly, making it a future-proof choice for optimizing images on websites.

An example of converting a large graphic from PNG to AVIF format:

Image compression tools

Choosing the right image compression tool depends on your needs and preferences. Here are some popular tools that can help you optimize for web pages:

Internet tools (kraken.io, TinyPNG, JPEG-Optimizer)

These tools allow you to compress images online without installing additional software. They are easy to use and often offer the ability to compress multiple files simultaneously. TinyPNG and JPEG-Optimizer are particularly popular because of their ease of use.

Adobe Photoshop

Photoshop is a professional graphics tool that offers advanced image compression options. The "Save for Web" function allows you to adjust JPEG, PNG and GIF compression settings, which allows you to control the quality and size of the file.

ImageOptim

ImageOptim is a tool for Mac users that allows easy compression of graphics via drag and drop. The program supports various image formats, including JPEG, PNG and GIF, and offers lossless compression.

FileOptimizer

FileOptimizer is a free tool for Windows that compresses various file formats, including images. The program optimizes files without losing quality, so it's an ideal choice for those who want to maintain the highest image quality.

Practical tips for compressing images without losing quality

  1. Choose the right format: Use JPEG for photos, PNG for graphics with transparency, GIF for simple animations, and AVIF or WebP for general high quality compression.
  2. Use online tools: Online image compression tools, such as TinyPNG or kraken.io, are easy to use and offer effective compression without significant quality loss. However, if you are converting graphics to AVIF or WebP formats, prior compression is not necessary.
  3. Adjust compression settings: If you use programs such as Adobe Photoshop, adjust the compression settings to find a balance between quality and file size. Always check the preview image to make sure the quality is acceptable.
  4. Optimize image dimensions: Before you go into compression, reduce the dimensions of the images to the actual dimensions displayed on the page. There is no point in uploading images at 4000×3000 if they are displayed at 800×600.
  5. Use batch optimization tools: If you have a lot of graphics to optimize, tools like ImageOptim or FileOptimizer allow you to compress multiple files at once, saving time and effort.
  6. Check the effects of compression: After compressing images, always check their quality and impact on page load time. Tools such as Google PageSpeed Insights can help you assess these factors.
compression of images for the website

Responsive graphics - techniques and tools

You need to remember that users browse websites on a variety of devices - from desktops to tablets to smartphones. To ensure an optimal user experience, images on the site must be responsive, that is, adapt to different screen resolutions. Here are some techniques and tools for creating responsive images:

  1. Srcset and sizes: HTML5 introduced the srcset and sizes attributes, which allow the browser to select the appropriate version of an image based on the screen resolution and display size. Here is an example
    <img src="image-800.jpg" srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w" sizes="(max-width: 600px) 100vw, 50vw" alt="Example image"

In the example above, the browser will select the appropriate image based on the width of the user's screen.

  1. Element picture: The element allows for more advanced control of image display. It allows you to define different versions of an image for different conditions, such as device type or screen orientation:


    .
      .
      .
      <img src="”image-default.jpg”" alt="&quot;Example" obraz”>
    .


    This allows you to customize the image for different scenarios, ensuring optimal display on all devices.
  2. CSS media queries: Media queries in CSS allow you to adapt styles, including image sizes, to different screen resolutions. Here's an example:

    img {
      width: 100%;
      max-width: 800px;
    }

    @media (max-width: 600px) {
      img {
        max-width: 400px;
      }
    }

    In this case, the image will have a maximum width of 800 pixels on large screens, but will shrink to 400 pixels on devices with a screen width of less than 600 pixels.
  3. Tools for automatic responsiveness: Platforms such as Cloudinary and Imgix offer powerful tools for automatically adapting images to different devices. They allow you to dynamically generate appropriate versions of images based on parameters such as screen resolution, device type or internet connection speed.

Alternative texts (alt tags)

Alternate texts, also known as alt tags or alt attributes, are short descriptions of images that help both search engines and users using screen readers understand the content of a graphic. Alts play an important role in optimizing images for web pages, affecting SEO and site accessibility. 

Alt tags - importance for SEO

Alternative text has a direct impact on optimizing images for SEO. Here are some key reasons why it's so important:

  1. Search engines and indexing: Alternative text helps search engines, such as Google, understand what an image represents. Because search engines don't "see" images in the traditional way, they rely on alternative text to determine what's in an image. This, in turn, affects the indexing and ranking of the page in search results. Images with well-written alt tags can appear in search results for graphics, increasing the chances of traffic to the site.
  2. Availability: Alt text is essential for people using screen readers who read web content aloud. By describing images with alt attributes, you ensure that people who are blind or visually impaired can understand what the images on the page represent. This improves accessibility and complies with WCAG (Web Content Accessibility Guidelines).
  3. Better user experience: If there are problems loading an image (e.g. due to a slow internet connection), text will be displayed on the page instead of the image, telling the user what should be there. This makes the page more informative, even when images are not visible.

How to write effective alternative texts

Describing graphics requires taking into account a few key principles. Here are some tips:

  1. Be descriptive but concise: Alts should describe exactly what is in the image, but at the same time be concise. Try to limit yourself to one or two short sentences that capture the essence of the image. For example, instead of writing "Picture of a dog," write "Picture of a dog playing with a ball on the beach."
  2. Use keywords naturally: Including keywords in texts can help SEO, but avoid "stuffing" them in. The alt attribute should sound natural and be understandable. For example, instead of "image optimization, image compression, SEO," write "Example of image optimization and image compression for better SEO."
  3. Note the context: The alternative text should reflect the context in which the image is used. If the image is part of an article about travel, the text should refer to that context. For example, "A map showing the top tourist attractions in Paris" is more useful than simply "Map of Paris."
  4. Check for grammatical and spelling correctness: Alts are part of the content of the site, so it is important that they are grammatically and spelling correct. Errors can affect the understanding and professionalism of the site.
  5. Use alts for all images: Every image on the site should have an alt attribute. Even decorative images can have short descriptions that add value. If an image really doesn't add informational value, you can use an empty alt attribute (alt=""") so that screen readers skip it.

An example of effective alt text:

<img src="”obraz-pies.jpg”" alt="&quot;Dog" rasy golden retriever bawiący się piłką na plaży”>

optimization of graphics for seo

Site performance monitoring tools

There are many tools that can help analyze and identify image problems.

Google PageSpeed Insights

Google PageSpeed Insights is a free tool that analyzes website performance on desktop and mobile devices. The tool evaluates various aspects of performance, including image optimization, and gives recommendations for improvement. Google PageSpeed Insights also provides detailed information about page load times and indicates which images can be compressed or reduced in size.

GTmetrix

GTmetrix is a website performance analysis tool that offers detailed reports on various aspects of optimization, including images. GTmetrix uses data from Google PageSpeed Insights and YSlow to provide a comprehensive performance evaluation. The tool gives detailed recommendations for graphics compression and other optimization measures.

WebPageTest

WebPageTest is an advanced website performance testing tool that allows you to run tests from different locations around the world and on different browsers. WebPageTest provides detailed reports, including image performance analysis, so you can identify problems and implement appropriate fixes.


Optimizing graphics on a website - summary

Effectively optimizing images for SEO is a very big step toward improving site performance. Compressing graphics, reducing their size, adding alternative text and using responsive techniques are basic methods that help speed up page loading and thus increase visibility in search results. Using the right image optimization tools and plugins and regularly monitoring site performance are steps that translate into a better user experience and higher search engine rankings. 

Remember, SEO-optimized graphics not only mean a faster website, but also more satisfied users and better business results.


Do you need a professional website that is effectively optimized for graphics and speed? Take advantage of free quote At our agency and see how we can help you achieve online success!

Get a feel for what profitable is marketing on the internet
Did you like the design? It's time for your turn!