How to reduce image file size: dimensions, quality, format
Cut pixels first, then lower quality, then consider a different format. Halving width and height removes about three quarters of the file before quality is touched, which is why resizing beats aggressive compression.
ConvertBoxPublished
The three levers that set file size
An image file is, roughly, the number of pixels multiplied by the average number of bits spent on each pixel. Pixel dimensions set the first factor. Compression quality and file format together set the second. Every way of making a picture smaller pulls one of these three levers.
They multiply rather than add, so order matters. A quarter of the pixels at half the bits per pixel is one eighth of the file. The levers also differ in what they cost: fewer pixels cost sharpness when the image is enlarged, lower quality costs clean edges and smooth skies, and a format change costs compatibility.
Lever one: pixel dimensions
Pixel count is width times height, so it falls with the square of the scale. Halving both sides leaves a quarter of the pixels and roughly a quarter of the file. A phone photo of 4032 x 3024 pixels has 12.2 million of them; a laptop screen shows about 2 million. Sending the full 12 million to someone who will view the picture on a screen spends five sixths of the file on detail nobody sees.
Cropping works on the same lever from the other direction: it removes pixels you do not need and leaves the rest at their original scale. Crop before resizing, so the pixels you keep go to the subject.
Lever two: what quality 80 means
A JPEG encoder transforms each 8 x 8 block into frequency values and divides them by a table of step sizes; the larger the steps, the more values round to zero and the smaller the file. The quality number scales that table. In the widely used libjpeg convention, quality 50 uses the base table, quality 80 uses steps 40% as large, quality 90 uses 20%, and quality 100 sets every step to 1. So the number is not a percentage of the original quality or of the original size, and the scale is steep at the top: going from 90 to 100 can double a file for a difference you cannot see.
Two consequences follow. Different encoders define the scale differently, so 80 in one program is not 80 in another, and a WebP quality of 80 is not a JPEG quality of 80. And 75 to 85 is the range where photographs lose a lot of bytes and little that is visible; below about 60, blocks show in skies and noise gathers around text.
Lever three: format, chosen by content
Format changes the bits per pixel at a given appearance, and the right choice depends on the picture. Changing format is the lever to pull last, because the receiving side has to accept the result.
| Content | Smallest sensible format | Why |
|---|---|---|
| Photograph | JPG, or lossy WebP for the web | Lossy compression hides in natural detail |
| Screenshot or text | PNG, or lossless WebP | Flat areas compress well without loss; lossy output dirties the letters |
| Photo stored as PNG | Convert to JPG or WebP | Lossless photos are several times larger than they need to be |
| Graphic with transparency | WebP, otherwise PNG | JPG has no alpha channel |
A worked example with real numbers
Take a 4032 x 3024 phone photo that is a 4.0 MB JPEG and has to get under 500 KB.
- Starting point: 4032 x 3024 = 12,192,768 pixels. Uncompressed at 3 bytes per pixel that is about 36.6 MB, so the camera's JPEG already spends only 4,000,000 x 8 / 12,192,768 = about 2.6 bits per pixel.
- Resize to 1920 x 1440: 2,764,800 pixels, which is 22.7% of the original. At the same bits per pixel the file would be 4.0 MB x 0.227 = about 0.9 MB. In practice it is a little more, because a downscaled picture packs more detail into each pixel.
- Lower the quality: camera JPEGs are saved at a high setting. Re-encoding at 80 typically needs around half as many bits per pixel, which brings the file to roughly 0.4 to 0.5 MB.
- Change format only if needed: if the destination accepts WebP, the same appearance usually costs somewhat less again. If it does not, stop here.
What the compress tool does, exactly
The ConvertBox image compressor pulls two of the levers at once, which is convenient but worth understanding before relying on it.
- Dimensions: any image whose longest side exceeds 1920 pixels is scaled down to 1920. The cap cannot be switched off, so it is not the tool for print files or full-resolution archives.
- JPEG and WebP: the slider, 10 to 100 with a default of 80, sets the encoder quality.
- PNG: there is no lossy setting for PNG in the browser, so the slider removes pixels instead. The pixel count is multiplied by the slider percentage, so at 80 each side becomes about 89% of its length and at 50 about 71%. A photographic PNG shrinks far more if you convert it to JPG or WebP.
- Timing: compression starts the moment files are selected, using the slider's current value, so set the slider first.
- Side effects: metadata including GPS position is removed, a HEIC photo comes out as JPEG under its original file name, and an already heavily compressed image can come out larger, in which case keep the original.
Upload limits and email attachments
For a form with a hard limit, work backwards from the limit. A 200 KB cap on a 600 x 800 photo allows 1,600,000 bits for 480,000 pixels, about 3.3 bits per pixel, more than the camera spent in the example above, so no visible loss is needed. The same 200 KB on a 3000 x 4000 scan allows 0.13 bits per pixel, which no quality setting reaches cleanly; the dimensions have to come down first. The resize tool sets exact pixel sizes and saves in the input format at quality 92, and the crop tool always saves PNG, so a cropped photo should go through the image converter or the compressor afterwards to become a small JPG.
Email adds its own overhead. Attachments are sent as Base64 text, which turns every 3 bytes into 4 characters, so with line breaks a file grows by roughly 37% in transit. Under a 25 MB message limit, about 18 MB of attachments fit. Ten phone photos at 4 MB each do not; the same ten at 1920 pixels and quality 80 total around 5 MB.
What not to do
- Do not re-save the same JPG repeatedly. Each lossy save approximates the previous one, and the damage adds up. Go back to the original for every new version.
- Do not upscale to meet a minimum size. Enlarging interpolates between existing pixels: the file grows and no detail is added.
- Do not push quality below 50 to hit a limit when the dimensions are still large. Fewer pixels at quality 80 look better than many pixels at quality 30.
- Do not overwrite the original. Shrinking is permanent, so keep the full-size file and treat the small one as a copy.