June 14, 2023

Choosing the right image format for web

One crucial decision that tends to slip our minds in the labyrinth that is putting together our online presence, is making the right image format choice. Sounds geeky, doesn’t it? However, this simple decision can have a huge impact on your site size, loading speed, user engagement, and’ yes, even the carbon footprint. Time to demystify and embrace this vital aspect, shall we?

Do I even need this image?

Before we dive into image formats, let’s take a step backwards and question the basics: Is an image actually necessary?

You know, it’s tempting to just splatter high-quality images indiscriminately all over your website because it’s pretty, right? But, the key here is to strike a harmonious balance, keeping things light so they load fast while still looking appealing.

In other words, it’s crucial to question whether any added image would actually provide valuable context or information your content or if it’s just there for decorative purposes. If it’s the latter, maybe you should reconsider.

Think of websites that use engaging graphics that tell a story. Here, images aren’t merely decorative; they are part of the overall user experience, helping visitors navigate your site or understand your offerings better. A thoughtful use of images benefits our audiences by creating a visually appealing, but data-friendly, experience. Plus, your site will load much faster.

And let’s not forget about accessibility and inclusion. Our audiences that use screen readers experience images differently, and then there is the issue of representation. I’ve known people who actively walk away from a website and their offering because all the images on the site are of able-bodied, white, cisgender, thin people. They feel its not for them.

It’s a critical choice strongly impacting the performance, accessibility and inclusivity of your website. The way we select, present, and our images can send powerful messages to those who come across our site. With a bit of understanding and consideration, you can pick the optimal format suiting your requirements and aid in crafting a more inclusive and resilient web.

Understanding image formats.

Alright, so you’ve decided that an image is necessary. Next, we tackle the various image formats. Let’s get gritty with JPG, PNG, WebP, SVG, and, because everyone loves a good meme, GIF.

JPG: The classic option for photos.

First up, the classic JPG. Formally known as Joint Photographic Group, JPG is a standard for professional photographers and graphic designers because of its ability to compress large high-quality images into small sizes ideal for storage and sending. Data compression in JPG results in minor loss of quality, but the difference is typically not noticeable for common use.

JPG supports a maximum of16.7 million colors, which makes it a suitable choice for complex images like photographs or other detailed, high-quality images. One downfall of the JPG image format is that it does not support transparency, so it’s not suitable for images that require a transparent background like logo designs and icons.

It’s also important to note that every time a JPG image is edited and saved, it loses a bit more data. So it’s not an ideal format for images that are still in the editing process. This is a characteristic known as ‘lossy’ in the digital world.

So, while JPGs are great for photos and detailed images thanks to their high color support and small file sizes, they might not be the best choice for images requiring transparency or for images that are still in the editing process.

PNG: The reliable choice for transparency

Next up is PNG; standing for Portable Network Graphics, PNG is a reliable choice for those who need image transparency. It supports both index transparency and alpha transparency, providing you with more control and smoothness when working on complex images.

Unlike JPG, PNG uses lossless compression, meaning it preserves all the original data even after compression This ensures the image maintains its quality, regardless of how many times it’s opened or saved. PNGs are ideal for digital artwork, logos and any images that transparency and high-details.

However, the tradeoff of PNG’s high-quality preservation is its larger file size compared to other formats. Therefore, although it might not be the best choice for large images intended for web use, PNG is a solid choice for various design purposes due to its flexibility and preservation of quality.

SVG: The versatile vector graphic

Now, let’s talk SVG or Scalable Vector Graphics. Ideal for logos and icons, these graphics are made of vectors, meaning they can be scaled up or down without losing quality. They’re typically smaller in file size than raster images, which gives your page load speed a nice little boost.

SVG files are also able to support interactivity and animation, providing you with a wider range of designing possibilities. However, SVGs can require more technical know-how and aren’t supported by every image-editing program out there.

Therefore, it’s critical to understand your design needs and technical resources before choosing SVG as the primary format.

GIF: The fun choice for animation

And, of course, who could forget the internet’s darling, GIF. GIFs stand for Graphics Interchange Format. were developed by the U.S. tech giant, CompuServe, in1987 and have since gained massive popularity on the Internet. Loved for their animation capabilities, GIFs can bring life to a website. But beware, these fun little files can quickly increase your page size and slow down load times.

While GIF are generally viewed as a lightweight, versatile media format compared to other types of animation, they do have their drawbacks. For example, the limited color palette can sometimes result in distorted colors, particularly when used in high-quality photographs. Furthermore, despite their seemingly small size, GIFs can significantly slow down the load time of a webpage if used excessively.

To add to the list of drawbacks, since they don’t have start and stop control to the animations can cause issues with accessibility (some people get motion sickness from movement on screen and need to be able to stop it).

WebP: The efficient modern format

Onto the new kid on the block, WebP. This modern image format provides lossless and lossy compression, making it pretty flexible. In simple words, you can choose between preserving every image detail or trading off some quality for a smaller file.

The ability of this format to offer transparency means that it can be used for creating image overlays and watermarks. This is especially helpful in the world of graphics design where the need to incorporate multiple elements across various layers is common.

Furthermore, the animation makes it superior to other image formats. This is because it gives the ability to create moving images without the need for additional software. This comes in handy in creating captivating visuals advertisements, presentations, and website designs.

A few years ago, there was concern over the adoption of WebP Images by browsers, luckily today, all current browsers and several previous versions are compatible with WebP Images and they

Making the right choice for you

Each image format has strengths and weaknesses. When weighing options, it’s important to consider their effect on file size, loading speed, environmental impact, and the trade-off between visual appeal and performance.

Today, my go-to image formats are WebP and SVG. These two formats offer the best balance between file size and image quality, making them efficient choices for web. I now save my JPEG and PNGs for images that will go to offline assets like brochures, business cards or press.

SVG is my default for line art, icons, and logos that must scale without distortion. I use WebP to handle all the raster images that would be too heavy for SVG or more complex and detailed.

But remember, always choose your image format based on your specific needs and the implications it might have on your website’s performance, accessibility, and user experience. I have the software and technical knowledge to handle SVGs, but that is not accessible to everyone. So if SVGs are out of your comfort zone, you can for example stick to WebP for a balance of quality and performance for all your images and graphics.

If your website uses WordPress, you can upload WebP images directly to the media library without the need for plugins or extra work. To convert your existing images, there’s a few plugins that allow for converting JPEG and PNG files in bulk SmushLiteSpeed Cache, and TinyPNG. For just a few images you can try online tools like Convertio, and Cloud Convert.

To wrap up, choosing the right image format isn’t just another tick on your to-do list. It’s a significant decision that can impact your website’s performance, accessibility, and inclusivity. With a bit of knowledge and thought, you can choose the best formats for your needs and contribute to a friendlier, more inclusive and sustainable web.