Choosing the right image file type is one of the lesser-known aspects of building a well-optimized WordPress website.
Did you know there are actually many different image formats? Most people know about JPG and PNG but have you heard of SVG, BMP, or WebP?
All of these different image types have their own advantages and disadvantages. Choosing the right ones for your WordPress site depends on a number of factors. Keep reading to find out everything you need to know about image file types for WordPress.
Why Choosing the Right Image File Type Matters
The image file type that you choose can affect the performance of your website. That’s why it’s important to understand the different image types and the benefits and drawbacks of each.
But before discussing the different file types, here are some ways that images affect your website.
One of the most important things to consider when uploading images to your website is how they might affect page load times. Large images can take up a lot of space on your server and this can cause your site to load slowly.
Well-optimized images can speed up page load times and improve user experience.
There are many factors that affect a website’s SEO ranking and page speed is one of them. Which is why website hosting and SEO is so important. You can improve your website’s search engine rankings by using quality images with small file sizes.
Look and Feel
Choosing the right image file types can either add or detract from your site’s overall aesthetic appeal. Some image types preserve details better than others. Clear and crisp images give your website a professional look.
There are multiple browsers and device types that users will use to access your website. When choosing which image types to use on your site, you should take into account both device and browser compatibility.
Being consistent with your choice of image type helps to give your website a professional feel. Different image types may display in slightly different ways and this could look strange to those with a keen eye for detail.
Most Popular Image Formats For Websites
The two most popular image file formats for websites are PNG and JPEG/JPG. According to w3techs, more than 70% of all websites use these file types. Around 30% of sites use SVG and 22% use GIF.
WebP and BMP are 5th and 6th in terms of popularity. These formats are much less widely used. But just because they aren’t used by many websites, doesn’t mean shouldn’t use them. More on this later.
What Are the Different Types of Image Files?
Before discussing the different image file types, it’s important to understand image compression and the difference between raster and vector images.
Compression: Lossless vs Lossy
When it comes to image compression, there are two kinds: lossy and lossless.
Lossless compression removes redundant data from an image. The entire file is reduced to save space.
But lossless compression also tells the computer what was removed and how to reconstruct the image. Lossless compression reduces image size without losing quality.
Lossy compression, on the other hand, removes some of the meaningful data from an image. This results in a loss of quality.
Images compressed by lossy compression lose some of their data for good. This means the original cannot be reconstructed.
Raster vs Vector Formats
The most popular image file types (JPEG, PNG, GIF) are all raster types. A raster image is composed of pixels that each have a fixed color, position, and size based on their resolution.
Raster images are static and the pixels are fixed. This makes it difficult to efficiently resize the image. If you scale it up, the pixels will be stretched to fit the space and the image will lose quality.
Vector formats do not use pixels. Instead, they are made up of lines and curves that can be scaled based on total area. This means you can enlarge images without any loss of quality.
JPG stands for ‘Joint Photographic Experts Group’. When you see a photo on a website or social media page, there’s a good chance it’s a JPEG file.
The JPG file type is good for photos, but not so much for graphics. JPGs save on a white background (not transparent). Although their file sizes are smaller than PNGs, they use lossy compression which means the quality will degrade the more times you edit and save the picture.
The PNG file format stands for ‘Portable Network Graphic’. Many images on the web are PNGs, especially graphics that need to retain a high level of detail, such as company logos.
PNGs are commonly used for graphics as opposed to photos. And they are the preferred choice for diagrams and illustrations. Unlike JPGs, PNG images are saved on a transparent background.
PNG also uses lossless compression, which means it retains more details than a JPG.
You know those annoying, animated loops that people love to post online? Those are GIFs. In fact, this is the only image file type that supports animation. GIF stands for ‘Graphics Interchange Format’.
GIFs have a limited color range and are best used for simple graphics. They use lossless compression and tend to be smaller than JPGs.
SVG stands for ‘Scalable Vector Graphic’. SVGs are vector images and use XML text to outline shapes and lines. This means you can scale them up or down without losing quality.
Vectors are best for simple graphics, shapes, and illustrations. SVGs are a good choice for logos, especially if you need your logo to be responsive. SVG is supported by most browsers including Chrome, Firefox, Edge, and opera.
BMP, also known as ‘Bitmap’, is an outdated file format. The disadvantage of BMP is that it uses little to no compression so file sizes can become very large.
BMP is supported by all major browsers. Stay away from using BMP images on your WordPress website as there’s really no reason to do so.
WebP is pronounced ‘Weppy’ and is an image file format created by Google in 2010. WebP has a number of advantages including providing better lossy and lossless compression than JPG and PNG.
On average, WebP images have smaller file sizes than PNG/JPG formats and therefore take up less space on your server. This can help you save bandwidth and speed up page load times.
The WebP format is gaining popularity but it’s still not supported by all browsers. Later versions of Chrome, Firefox, Edge, and Opera all support WebP.
Uploading Different Image Types to WordPress
By default, WordPress only accepts popular image formats. This includes JPG/JPEG, PNG, GIF, and ICO. The ICO format is used for favicons.
You can still upload other image file types (such as SVG and WebP) but you’ll need to use a WordPress plugin to do so. SVG files are prohibited by WordPress by default because the XML markup used in these files can open up your site to security vulnerabilities.
If you want to use SVG files, make sure you create them using a reliable image editor. To use SVG files on your WordPress site, there are several plugins you can use. Two of the most popular are ‘SVG support’ and ‘Safe SVG’.
By default, WordPress does not support the WebP image format either. The reason for this is that a large proportion of internet users don’t use a WebP compatible browser.
But fear not! There is a way around this, too.
You can use a WordPress plugin that will convert your existing images to WebP and retain the original file to display on browsers that don’t support WebP. Plugins that offer this feature include Jetpack, as well as third-party plugins such as ShortPixel, Imagify, and Optimole.
Optimizing Images For WordPress
Optimizing your existing images is important for reducing bulk and speeding up your website’s load time. Before uploading a new image to your media library, use an image editing program to compress it.
For example, Adobe Photoshop comes with the option to ‘save for web’. Selecting this option will automatically optimize your images for display on websites. There are also free tools available like GIMP.
If you have a website with a lot of un-optimized images, then don’t worry. You don’t need to edit and reupload each one. Instead, you can use a WordPress plugin to compress the images automatically.
Some of the most popular WordPress image compression plugins include ‘Imagify’, ‘EP Smush’, and ‘EWWW Image Optimizer’.
Best Image Format For WordPress
Determining which image file type to use for WordPress depends on how you’ll be using your images. Your aim should be to use images with the smallest file size possible while retaining clarity and detail.
WebP provides the best of both worlds (small file size and good quality), but it falls short when it comes to browser support.
When it comes to photos, JPG is a solid option. For graphics and logos, PNG works well. If your graphics lose quality when displayed large, consider converting them to SVG.
Optimize Your WordPress Site’s Performance
Part of increasing your website’s performance is choosing the right image file types to use. Large, bulky images take up a lot of space and decrease page speed. And highly compressed images can sometimes lack quality and detract from the user experience.
Choosing the right image file type for your WordPress website depends on how you’ll be using the images. You also need to consider device and browser compatibility.
If you found this blog post useful, be sure to check out more of our helpful WordPress content. And if you want to boost your website’s performance even more consider switching to our managed WordPress hosting.
Zach has 12+ years of experience with WordPress, from creating and maintaining client sites, to providing support and developing documentation. A knack for problem-solving and providing solutions led Zach to pursue a job with Automattic providing customer support in 2015 working with WooCommerce support, and now Zach has recently joined our team here at Pressable. Outside of work, Zach enjoys spending time with his family, playing and watching sports, and working on projects around the house.