Reducing image sizes web pages

Most computer monitors are no more than 1200 pixels wide but your camera might take pictures which are 3500 pixels wide and several Mb in file size. Although you can load the whole photo and then specify the scaled size on the page if you do that your web page will take ages to load. This is the reason why we have a limit for 1 Mb for any attachment or picture (though this can be relaxed in particular cases if necessary, for example if you need high resolution for printing). You should normally aim to keep your image files less than 50 Kb if you can, certainly less than 150 Kb. The image size depends on the complexity of the picture as well as the number of pixels.

Yes, we know that most people have fast broadband. However, if you are using a smart phone on a basic mobile network, these file sizes really do matter!

How big do you need?

Take a look at some pages on the website with pictures on, such as these below

Left is 304x211 pixels jpg, 135 Kb. This is a large file because the picture is very complex.

Below is 800x600 pixels jpg but only 25 Kb. This is a relatively simple picture (not so many edges) and it was generated from PhotoShop using 'Save for web...' which strips unnecessary information about how the picture was taken out of the file.

To see how big an image is in pixels:

Using FirefoxRight-click on the image and select 'View image Info' from the menu.
Using ChromeRight-click on the image and select 'Inspect Element'. Then select the 'computed' tab in pane on the right.

Reducing the image file size

There are several ways to reduce the size of an image file

  • By reducing the resolution, having fewer pixels - this is usually necessary if you start with a photo.
  • Using a more compact format - jpg is usually smaller than png or gif but it may not make a huge difference
  • For jpg you can reduce the size by choosing a low quality - not recommended.
  • Also for jpg some packages allow you to strip unnecessary information about how the image was taken out of the file. You can lose 20-30 Kb this way.

For more information on image file types read here

If you have some photo editing software there is usually a way to scale the image size. You should scale both dimensions equally, or you will end up with a distorted picture so look for an option such as 'Constrain proportions'. Ideally, after scaling you should be able to 'sharpen' the image but this is not vital.

The table below gives hints about some different ways to scale images depending on your software.

Using PhotoShop or PhotoShop ElementsUse Image/Resize... and then sharpen it and use 'Save for web..' to strip out unnecessary information.
On Mac OS use PreviewTools/Adjust Size...
On Mac OS use iPhotoThe Export function allows you to set a size. You can set a custom size.
On Unix platforms using ImageMagick (free software)convert -resize NxM will reduce the file size to no more than N wide or M tall
On Windows platforms using PaintResize... and tick 'Maintain aspect ratio'. Detailed instructions here
Using PicasaAs with iPhoto, you have size options on the Export function.

Wiki How 6 ways to resize digital images has more details on some of these options and also lists some free web services.

Let Nicola know if you have more suggestions for this page.

Share this page