
As we know, there are tens if not hundreds of different screen sizes out there, and we somehow must make sure that our images are going to look great on all of them. This is perhaps the most crucial aspect of the whole “responsive images” riddle. 📏 Serve images of the correct dimensions Then, you can get that image and upload it to your site normally. You can just grab an image from the desktop, drag and drop it onto ImageOptim, and then the tool does its magic and overwrites the source image when done. ImageOptim for desktop compression on Mac. Two of my favorite tools that can help you here are: In general, all images that the visitor is not directly engaged with can be lower in quality. For instance, backgrounds don’t need to be 100% crisp. Okay, I should clarify yes, when you want to show them something – like an image that’s key to a piece of content, e.g., product images, hotel room photos – then sure, those ones should be crisp.īut in other areas, you can be a bit more relaxed. The truth of the matter is that your site visitors don’t care for crisp images everywhere. Overall, you can take a leap here and downscale the quality of your JPGs pretty heavily. However, not all images are created the same, so sometimes you might get okay-looking images next to bad-looking images even though they underwent the same compression process. This JPG compression can be handled fairly automatically by various tools, which is great news. Huge, right?! You can go from ~1 MB to ~500 KB with no noticeable loss in quality at all, just by changing the compression from 100% to 95%. Here’s how much disk space each of these images takes: The fourth one starts looking “a bit worse.” (Right click and “Open Image in New Tab”)

If you’re like most people then the first three look the same to you. You can save images as WebP in Photoshop, or use a tool like XnConvert (free).
#Optimize images for web online manual#
Still, I do recommend going this complicated manual WebP route whenever you’re dealing with images that appear on multiple pages within your site, or images that are huge in size and you need every tool you have to reduce that size some way. And let me stop you right there, no, WordPress doesn’t support WebP natively, so you will indeed have to do that by hand. Imagine having to build a tag like that every time you want to add a WebP image to a blog post or page. To effectively use WebP, you should provide fallback images. … but if the user’s browser doesn’t support the format, they’ll see the familiar broken image icon instead.
#Optimize images for web online code#
I mean, you technically can use a piece of code like this:

What this means in practice is that adding a WebP image isn’t as straightforward as adding a JPG or PNG. Of course, the older versions don’t support the format. In fact, you may not even see the WebP image I’ve used above. At the time of writing, WebP works in Google Chrome, Firefox, Edge, and Opera. The trick is that not all browsers support WebP. Check out these two example images from our article covering Sketch alternatives for Windows:: The format is great, and in most cases, it does indeed save a lot of disk space just as promised. In most scenarios, SVGs are not a format you’ll use very often. This is not always something you want – especially when dealing with your brand’s logo or other crucial graphics. Basically, use SVG only if (a) the image can be saved as SVG efficiently, and (b) if you don’t mind people taking that SVG and modifying it.Īs I said, SVG is XML-based, which means that modifying SVG graphics is really easy to do. So what’s the catch? Can you optimize images by turning them all into SVGs and WebPs?įirst, SVG. They brag that WebP is 25-34% smaller in size than comparable JPEGs, and 26% smaller than comparable PNGs. This makes SVG a good format, as long as you’re dealing with a simple vector image. The contents of the image can be defined in a simple XML file – the same XML file you’d use for other basic data processing purposes. SVG is an XML-based vector image format.


SVG and WebP are a bit less common image types on the web, but they are both great as long as you’re using them as they should be used. Now for a bit more timely question: SVG? WebP? SVG and WebP Predict how big the image is going to be based on its contents, and then use the correct image type.
