How to get a photo under a file-size limit
The difference between file size, pixel size and DPI, the order to work in when a form wants a small photo, and what to do when the limit is tiny.
Work in three steps: crop the photo to the shape the form wants, resize it to the pixel size it wants, and compress it to the size limit last. Compression is the step that loses quality, so it should happen once, at the end, on a picture with no pixels to spare. Changing the DPI will not get you under a limit, because it does not change the pixels.
File size, pixel size and DPI measure different things
A limit such as 100 KB is about file size: how many bytes the saved file takes up. Pixel size is the width and height of the picture, such as 600 × 600 pixels. It decides how much detail the photo can hold. DPI, short for dots per inch, is a number stored inside the file. It tells a printer how many of those pixels to place in each inch of paper.
More pixels usually need more bytes, and a lower quality setting needs fewer bytes for the same pixels. DPI affects neither. The same 600 × 600 photo prints 2 inches (5.08 cm) wide at 300 DPI and 8.33 inches wide at 72 DPI, with identical pixels. When a form gives a print size and a DPI, multiply them to get the pixel size they add up to: 35 × 45 mm at 300 DPI is about 413 × 531 pixels.
The result text and the download button count 1 KB as 1,000 bytes, so a file of 99,800 bytes reads 99.8 KB in both places. A form that counts 1,024 bytes to the KB allows slightly more, never less.
A new DPI value leaves the pixels alone
A JPEG stores its DPI in a small header field, and a PNG in a short section called pHYs. Change image DPI writes your number, such as 300, into that field and does not touch the pixel grid. The result tells you how large the picture prints at that setting: 1200 × 1800 pixels at 300 DPI comes out at 4 × 6 inches. With JPEG chosen under Save as, the tool also saves the picture again at 92% quality. That matters for the order of steps below.
Step by step: crop, resize, then compress
- Measure. Image dimensions reads the width, height and file size of your photo, so you know how far you have to go.
- Crop to the shape. Square image crop cuts the center square and sets its Output edge in pixels in one go. Image aspect ratio crop cuts 16:9, 9:16, 4:3, 3:2, 4:5, 2:3 or 1:1 from the center. For any other shape, or a face that is off center, Image crop takes Left, Top, Width and Height in pixels.
- Resize to the exact pixel size. Image resize takes the Width and Height you enter. Set its Fit to Fill the size and crop the overflow, which trims any overflow from the center, so nothing is stretched. Stretch to the exact size forces the numbers even when the proportions differ, which can squash a face.
- Compress last. In Compress image to target KB, type the limit into Maximum size in KB and choose JPEG under Save as, unless the form lists WebP. The guide to JPEG, PNG and WebP explains why. If the form fixes the pixel size, set If quality alone is not enough to Keep dimensions, so the tool cannot shrink the picture.
The crop and resize tools save PNG, which is lossless, so the photo loses quality only once, in the last step. A PNG of a large photo can pass 20 MB, the most StillKit's image tools accept. If the next tool refuses it, shrink it first with Resize image by percentage. Keep Save as on Same as original so that it stays PNG.
How the target-size tool searches
The tool first saves your photo at 92% quality and keeps that if it fits. Otherwise it tries the lowest quality it allows: 40% when smaller dimensions are allowed, 5% when they are not. If that fits, it narrows the range in six steps and keeps the highest quality that stays under the limit. If even the lowest quality is too big, Allow smaller dimensions shrinks the width and height and tries again, up to six sizes in all. Keep dimensions stops instead and tells you how small the file could get.
The result line sums it up, for example "Saved 98.7 KB (limit 100 KB) as JPEG at 61% quality, 1200 × 900 pixels". The file is named after the limit, such as stillkit-100kb.jpeg. The endings .jpeg and .jpg mean the same format, so if a form's file picker lists only .jpg, renaming the file is safe.
When the limit is very small
A limit such as 20 KB leaves room for very little detail. Before you accept a blurry result, try these in order:
- Crop closer. Background you do not need still costs bytes, and a busy background costs far more than a plain wall.
- Use fewer pixels if the form allows a range. Halving the width and height leaves a quarter of the pixels, which often looks better than pushing the quality lower.
- Take the photo again in good light. Grain from a dim room looks like fine detail to the encoder, so a grainy photo needs more bytes for the same look.
- Choose WebP only if the form lists it. At the same size it often looks better than JPEG, but a form that expects JPEG may refuse it.
Do not sharpen a photo right before a tight limit: crisper edges are more detail to store. If the tool reports that it could not get below your limit, it has run out of room to shrink the picture. Crop it more, or use a photo with a plainer background.
If the form also asks for a DPI value
These two tools do not combine neatly. Compress image to target KB builds a new file from the pixels, so it does not keep a DPI value you set earlier. Change image DPI saves a JPEG again at 92% quality, so running it after compression can push the file back over the limit.
Set the DPI as the very last step, choosing JPEG under Save as, and check the size on the download button. When the target-size result already reports 92% quality, the DPI step saves at that same quality, and the size usually changes little. If the file ends up over the limit and the form allows fewer pixels, resize the photo smaller and repeat both steps.