Making compact image files

Before embedding images in a web page or a pdf, it’s often a good idea to make sure they have a reasonable file size. You can also attempt to compress PDFs after they have been produced.

Lossy modifications

Shrink large images to be the size in pixels that you want to display. Image editors often resample images better than a web-browser will on the fly, so the images will look better and be quicker to download.

Use an appropriate image format. Generally use JPEG for photos, PNG for line-art. There are exceptions: if line-art has gone through JPEG and the original has been lost, it may be better to leave it as JPEG as the compression artifacts will mess up PNG compression.

Sometimes reducing the number of colours in a PNG file may help improve filesize without noticeably changing the image.

Lossless modifications

The following utilities losslessly improve the compression in image files, sometimes dramatically: