When an image is too large to email, upload or put on a page, it helps to know which of three things is responsible. They are not equally easy to change, and they do not save the same amount.
1. Pixel count
The number of pixels is the largest single factor. A 12-megapixel photograph holds twelve million colour values; no encoder can describe that as compactly as it can describe two million. Halving the width and height quarters the pixel count, and the file shrinks close to proportionally.
This is also the factor most often left untouched. Cameras produce far more pixels than most destinations need, and a phone screenshot is often two or three times the width of the space it will be shown in. Asking "how large will this actually be displayed?" usually reveals an easy two-thirds saving that no quality setting could match.
2. Format
The container matters almost as much. For the same photograph at the same visible quality:
- PNG is the largest, because it keeps every pixel exactly.
- JPEG is several times smaller, and is the safe choice for compatibility.
- WebP is usually smaller still, and supports transparency, but is not opened by some older desktop software.
The commonest avoidable mistake is storing photographs as PNG. It is a format designed for images with flat colour and sharp edges, and a photograph is the opposite of that. The file ends up several times larger with no visible benefit, because PNG is faithfully preserving detail the camera never really captured.
3. Encoder settings
Only relevant for lossy formats. The quality setting decides how much detail the encoder may discard, and it has sharply diminishing returns: the first reductions cost almost nothing visually, and the last ones before the artefacts appear make less and less difference to the file.
It is also the only one of the three that cannot be undone. Once detail is discarded it is gone; re-saving at a higher quality does not restore it. That is worth remembering before compressing the only copy of something.
Putting it together
A reasonable order of operations, which is also the order the compressor offers them:
- Decide the largest size the image will be displayed at.
- Reduce the dimensions to that size. This usually does most of the work.
- Choose the format: WebP for the web, JPEG for compatibility, PNG only when losslessness or sharp flat colour matters.
- Then adjust quality, and stop as soon as it looks right at the intended display size.
Doing it in that order means the quality setting is only asked to handle the last few per cent, where it does the least damage.