How to reduce an image to publish it on a website or blog

In this post I’d like to show you how to crop and reduce an image to include it on your blog or website. The first problem my clients run into when they start working on their website is that they insert huge images. Although most of the time they aren’t aware of it, this causes…

Imagen de una miniatura de un cochecito

In this post I’d like to show you how to crop and reduce an image to include it on your blog or website.

The first problem my clients run into when they start working on their website is that they insert huge images. Although most of the time they aren’t aware of it, this causes a number of problems that sooner or later show up:

  • Slow loading of the website
  • Harm to search engine rankings
  • Bandwidth consumption on the server
  • A worse experience for mobile users

It’s true that those of us who work on the web have completely internalized the idea of reducing images for the web (or should have), and sometimes we forget that others don’t necessarily understand it. So, although there are very good posts on this subject, I’ll try to compare the different methods available and explain how to use them.

But first, I need to explain some basic concepts that will help us understand this process better.

Concepts

Resolution and image size aren’t the same thing; the dimensions of each clearly affect the file size, so we need to understand what they are and how they work.

  1. Image resolution: in digital photography, resolution refers to the amount of detail you can see in an image, that is, for the same image size, how many pixels it contains. So the higher the resolution (always keeping the same image size), the more detail we get, as in this example taken from Wikipedia.
    Explanation of the concept of image resolution according to Wikipedia
    Resolution is usually expressed in dots per inch, and two values are commonly used depending on what we’re working on: if we’re working on photos to be printed at a print shop or on our printer, we’ll work at 300 dpi; however, if we’re working with an image to be published on the web, we’ll work at 72 dpi. This greatly affects the image’s weight (its file size), which is vastly smaller in the second case.
  2. Image size: when we talk about image size, we mean its dimensions, which may be in centimetres if we’re working on a poster or an image for a book, but for an image to be published on the web they’re expressed in pixels. Pixels are the little squares on our computer screen: the more there are, the higher its resolution, and the fewer there are, the lower its resolution. As you can see, we’ve come back to the concept of resolution, but applied to our screen.More than once I’ve had a client who wanted to measure image size with a ruler in centimetres and, of course, the numbers didn’t add up. That’s because, depending on the screen resolution, the same image size will look smaller or larger.There are no fixed sizes for publishing on the web, since they’ll vary depending on our needs and the dimensions our site’s theme imposes. As a guideline, though, we can try to use images 250 to 400 px wide for images inside our blog posts; if they take up the full width, they shouldn’t exceed 800 px wide; and for sliders (not recommended at all) or full-screen header images, we can work with sizes from 1,200 to 2,500 px wide. But always bearing in mind that this will affect the image’s weight or file size.
  3. Weight or file size: there’s not much to explain here: it’s basically the disk space an image file takes up. It grows exponentially as the image size increases, so we must be very careful when exporting the images we’ll insert on our website, since small variations in size (we already know resolution will always be 72 dpi) translate into considerable variations in weight, which in turn means faster or slower page loading.Although there are no standard figures either, it’s said that to avoid hurting SEO, a slider image should weigh no more than about 100 KB, and smaller images within the site should weigh at most around 50 KB. My experience is that it’s very hard to reach these file sizes, so we should try to get as close as possible as long as we don’t think image quality is being lost.

Methods

Next I’ll explain the different image reduction methods, from those used by design professionals to others for less experienced users. In any case, always bear in mind that we start from an image size in pixels (for example 2,000 x 3,500 px), and that we can reduce it, but never enlarge it. That is, if we start with a 200 x 450 px image, there’s little we can do. You can’t get blood out of a stone.

As I said, I’ll explain different image reduction methods, starting with Photoshop and GIMP. Then, after researching and looking at other professionals’ recommendations, I found two relatively recent posts (in Spanish) listing a number of tools. The first from Hipertextual, and the second from José Facchin, which list some simple web and desktop tools for reducing images. The problem is that after using one that didn’t quite convince me, I decided to do a comparison and choose based on the numbers.

For this test, I started from two photos I took with an ordinary compact camera (Canon PowerShot SX220 HS). Straight from the camera, I reduced them in each application and calculated the reduction percentage, taking the photos’ original size as 100%. In the applications that allowed it, a crop was made; where it wasn’t possible, I point out that cropping isn’t supported.

Photoshop

This method isn’t within everyone’s reach, although Photoshop is one of the programs most people have installed on their computers (inexplicably). For me it’s the method I prefer, since it gives the most control over the image. I won’t explain here how to reduce images with Photoshop, but if you want to use this method, I invite you to follow the tutorial on this blog (in Spanish); here I’ll summarize the steps conceptually.

When we want to reduce an image with Photoshop, the process is almost always the same:

  1. Open the image in Adobe Photoshop
  2. We’ll often need to set specific proportions, that is, a specific image width and height. For this, we’ll use the Crop tool. Here we define the image’s proportions in pixels and crop away all the excess.
  3. Once the image is cropped, it’s time to export it reduced to the final size we want. We’ll do this with two possible tools, both in Photoshop’s File menu: Export As…, the current method and the one Adobe recommends; and Save for Web (Legacy), the old method, still in the program at the time of writing, which is the one I still prefer.Here we must always bear in mind that the output resolution for the web is 72 dpi (dots per inch), while for documents to be printed it’s much higher, 300 dpi. This makes images for print enormous compared with images for the web.

Careful, it’s very important not to get confused: although in step 2 we talked about defining proportions in pixels, what we’re defining is exactly that, proportions. That is, the ratio of the image’s width to its height, which we define with the final size in pixels, but which is applied to the original image size. This will make more sense if you watch the tutorial on how to reduce images with Photoshop.

And that’s it: these are the steps to reduce an image for the web with Photoshop. What was the result? We started from Photo 1, with an original weight of 2,326,854 bytes (2.22 MB), and Photo 2, with an original weight of 3,919,094 bytes (3.74 MB).

As mentioned, Photoshop has two ways of doing the final export: Export As… and Save for Web. The result isn’t the same, so below I show the file sizes and the percentage by which the image’s weight was reduced at different quality levels.

Data from the comparison of Photoshop reduction methods
Chart comparing the size reduction of Photo 1 with the two Photoshop methods
Chart comparing the size reduction of Photo 2 with the two Photoshop methods

As we can see in the charts comparing the sizes obtained for Photo 1 and Photo 2 with the two Photoshop methods at different qualities, the “Save for Web” method is more effective and produces a slightly smaller image (except for the strange exception in the unlikely case of quality 100).

The quality to choose depends somewhat on the final result you get; it may be worth doing a couple of tests and keeping the one that doesn’t affect how the exported photo looks.

GIMP

GIMP 2 is like a free Photoshop, that is, open-source image editing software, completely free of charge. This one is within everyone’s reach and is every bit as good as Photoshop (at least for basic image processing like what we’re discussing here).

If you want to follow a tutorial where I explain in detail how to reduce an image for the web with GIMP, you can see it here (in Spanish). In any case, the process is exactly the same as in Adobe Photoshop, with a slight variation:

  1. Open the image in GIMP.
  2. Set the image proportions in pixels with the crop tool (represented here by a cutter).
  3. Scale the image (Image –> Scale Image). This is the small difference from Photoshop: there we did this step during export, while in GIMP we do it before exporting.
  4. Export the image (File –> Export As) to the location where you want it, ready to upload to your website.

Some things to keep in mind are always the same:

  • we can reduce but we can’t enlarge an image without losing quality.
  • We must never mistakenly export at print resolution (300 dpi), as the image will be enormous. So we must make sure the resolution is 72 dpi.
GIMP reduction comparison
Chart comparing the size reduction of Photo 1 in GIMP
Chart comparing the size reduction of Photo 2 in GIMP

As we can see, the results of reducing file size with GIMP were quite good. Obviously, there comes a point where lowering the quality further doesn’t reduce the file size much more, so, as always, it’s best to balance reduction against the quality obtained.

Websites for reducing images

For the websites and small desktop apps studied and listed in the posts mentioned above, we’ll briefly describe the reduction process, share impressions and show numbers, which in the end are the most objective part.

  • Webresizer.com: A website that lets you do several things, including cropping the image as well as optimizing it. Basically, all you have to do is upload a file to the site (10 MB maximum). Then you can set the crop ratio if you want, followed by the new width or height. You can add a few more parameters, such as image quality, and even make some adjustments to it.
    Upload button and crop enabled in Web Resizer (webresizer.com)
    Screenshot of the form where we give Web Resizer the new size and other adjustments


    Data from reducing images with Web Resizer
    Chart comparing the size reduction of Photo 1 in Web Resizer
    Chart comparing the size reduction of Photo 2 in Web Resizer

    And how did Web Resizer perform at reducing the images? Let’s see.
    Webresizer’s final result is also quite good, without much difference between qualities 80 and 60.


  • Image Optimizer home page
    Image Optimizer:
    This app left me a bit puzzled. I don’t know if it’s just me, but whatever size I set, it always gives me the same 591 KB file. I suppose the web service has some problem causing this.
    There’s a desktop version you can download, but when they asked for my email, and given the dreadful result of the web version, I lost any desire to download it. If anyone out there spots what I’m doing wrong and tells me, I’ll gladly correct this part of the post.
  • Kraken.io: This app requires registration. Once we have an account, we can try the PRO Web Interface and then select the image optimization mode (Lossy, Lossless or Expert)
    In any case, this app offers three levels of reduction: Lossy, Lossless and Expert, depending on whether we want to reduce the image more, lose less quality or take full control of the process by adjusting various parameters. Finally, we can enter the image size (in the example here it was 1,200 x 674 px, the size we’ve used in all the previous examples).
    Data from reducing images with Kraken.io
    Chart comparing the size reduction of Photo 1 in Kraken.io
    Chart comparing the size reduction of Photo 2 in Kraken.io
    Kraken.io also gives a pretty good result, judging by the numbers. In any case, the clear conclusion is that it’s best to use Expert mode, as it’s considerably more efficient than the preset modes.
  • ImageOptim: it only works on Mac, so I decided not to include it in the comparison as it isn’t available to everyone. It’s a small desktop app that, according to the Hipertextual post, besides compressing images, strips their metadata and lets you compress several images at once. If you want to test it yourself and tell me the results, at the end of the post you can download the original photos and the spreadsheet where I recorded the results.
  • Optimizilla: Another little monster doing something in the web world, in this case reducing images. The only problem is that it’s somewhat limited, as it only compresses them; you can’t set the dimensions as in other apps. Perhaps that’s why the results were rather limited.
    It’s very simple to use: just upload the images to the site and select the quality you want.
    Optimizilla web app interface

    Because we couldn’t resize the images, the result is much less optimal than with the previous methods, although it would be worth testing with an image already at the final dimensions we want. We might be surprised.
  • TinyJPG or TinyPNG (as needed): Another extremely simple web app: drag and drop and get the reduced image. Again it has the same problem as the previous one: it doesn’t let you change the image dimensions
    TinyJPG app interface

    In this case, the images obtained are slightly less compressed than with the previous method, so Optimizilla seems to stay ahead among the apps that don’t resize.
  • Compressor.io: This web app only offers two options, Lossy and Lossless, and doesn’t let you resize the image, so in most cases it may fall short.
    Compressor.io interface

    Data from reducing images with Compressor.io
    Chart comparing the size reduction of Photo 1 in Compressor.io
    Chart comparing the size reduction of Photo 2 in Compressor.io

    The result was also a bit odd, since one of the options (Lossless) simply left the image as it was.

    Compressor.io wasn’t satisfactory at all. On one hand, it did nothing in lossless mode, while in lossy mode it compressed the image by around 50%.


  • Compressnow: Another “drag-reduce-download” site, but again we have the problem of not being able to reduce the image dimensions. The interface is very simple: choose the compression level with a slider, drag the image into the window or upload the file, and get the compressed file.
    CompressNow app interface


    Data from reducing images with Compressnow
    Chart comparing the size reduction of Photo 1 in Compressnow
    Chart comparing the size reduction of Photo 2 in Compressnow

    As for the results, let’s take a look. They varied quite a lot depending on the quality chosen, but this program seems somewhat more efficient than the previous one.


Conclusions

At this point, with all these numbers and comparisons, I think it’s worth summarizing so we can choose a program. Since it wouldn’t be fair to do it any other way, we’ll first compare the programs that allow resizing, and then those that don’t. Obviously the former give a better result, so they’re the ones I recommend. The latter may be useful if we resize the image beforehand, or if it’s already at the final size it will be displayed at on the website. In that case, we can also choose one of those analysed here.

Apps that allow resizing

As we said, this comparison includes the apps that allow resizing the image, an essential step if we have an image 4,000 px wide (as in the example used for this comparison).

Comparison of programs that reduce photos by resizing the image
Chart of results for programs that reduce by resizing the image, photo 1
Chart of results for programs that reduce by resizing the image, photo 2

The conclusion is quite curious: among the desktop programs, GIMP comes out on top at compressing, beating its paid competitor Photoshop. But the best part is that Kraken.io exceeded all expectations, so it takes the prize and beats them all. Personally I prefer Webresizer, and it’s probably the one I’ll recommend to my clients, but Kraken.io is very close and gives a very good result.

Apps that don’t allow resizing

On the other hand, let’s see the results for the apps that don’t allow resizing the image. Since we can’t resize, for me these apps are ruled out when it comes to recommending them to my clients. Still, let’s take a look just in case.

Comparison of programs that reduce photos without resizing the image
Chart of results for programs that reduce without resizing the image, photo 1
Chart of results for programs that reduce without resizing the image, photo 2

From these results, it seems clear that Optimizilla comes out on top, while Compressor.io gave a rather disappointing result. This, together with its simplicity, makes Optimizilla a good candidate for reducing images, as long as we don’t need to resize them.

So GIMP for desktop, and Webresizer or Kraken.io, were the winning apps in this comparison.

Other considerations

Here I’d like to give a couple of tips I think may be useful:

  1. Please, don’t upload images with the name the camera assigns or the one they came with from the internet. It’s very common to see images with the file name IMG_415.jpg. That tells nobody anything, least of all Google, which, along with our users, is who we should care about most.
  2. We should get into the habit of always filling in our images’ alternative text (alt). This text also helps people find us in search engines. Here we should always enter a short description of the image, since it’s intended to be read by people with visual impairments who browse our site using assistive technology.

Finally, if you want to download the original photos I used and repeat the tests, you can do so from the following link.

Download

Jesús Yesares Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *