Image too large to upload? Each fix, measured on...

Image too large to upload? Each fix, measured on a phone photo

By Mozex
5 min read
Bar chart of a 12.5 MP Pixel 8 photo after each fix, against 2 MB and 5 MB lines: 6.54 MB as uploaded, 5.66 lossless, 4.31 at quality 90, 2.60 at 75, 1.98 at 61, 1.63 at 75% size and quality 75, 1.33 at 50% size and quality 90.
On this page

A 12.5-megapixel photo from a Pixel 8 phone is 6.54 MB. Say a form caps uploads at 2 MB. Halving the photo's width and height got it to 1.33 MB at JPEG quality 90, with no compression damage you'd notice side by side. At full size, getting under 2 MB took quality 61, close to where the damage becomes perceptible. Changing its DPI didn't change its size by a single byte.

So when an image is too large to upload, make it smaller in pixels before you squeeze the quality. Here's how, what each fix cost, and what changes for a 50-megapixel photo.

Get a photo under the upload limit in four steps

  1. Note the limit, and aim about 5% under it. The section on units below says why.
  2. Open Iminify's JPEG compressor, switch on Resize, choose Scale and set Percentage to 50. For a 50-megapixel photo, start at 25. If the file ends in .heic, use the HEIC to JPG page instead; it has the same Resize switch.
  3. Leave the level on Smart and drop the photo in. A guest can upload up to 16 MB, a free account 32 MB.
  4. Download the result and check its size. Iminify's results list counts 1,048,576 bytes to the MB. Still over? Run it again at a lower percentage, or pick Ultra.

Iminify has no "make it 2 MB" setting, so the percentage is what you turn.

What each fix did to a 6.5 MB phone photo

This is the photo from the opening. MB here means 1,000,000 bytes. The score is SSIMULACRA 2, a perceptual quality measure on which 70 means artefacts you can see but that don't annoy, and 80 means no difference you'd notice side by side.

Fix Pixels Size Score
None, as uploaded 4080x3072 6.54 MB
Lossless repack 4080x3072 5.66 MB pixels identical
Quality 90 4080x3072 4.31 MB 86.1
Quality 75 4080x3072 2.60 MB 77.4
Quality 61 4080x3072 1.98 MB 71.5
75% size, quality 75 3060x2304 1.63 MB 76.2
50% size, quality 90 2040x1536 1.33 MB 84.5

The lossless repack is what Iminify's Lossless level does: it drops the metadata (about 125 KB here) and repacks the file without changing a pixel of the photo. That saved 13.4%, most of it from the repack. Not enough for even a 5 MB limit.

On this photo, Smart lands on the quality 90 row and Ultra on the quality 75 row. Smart looks for the lowest quality from 40 to 90 that keeps the error within its target, and this detailed photo misses the target even at 90 (37.1 dB of PSNR, a plain error measure, against the 40 it asks for). Ultra's top quality is 75, and it misses its own target there too (32.3 dB against 34). At full size, Smart clears a 5 MB limit but not 2 MB.

Don't convert a photo to PNG to shrink it. ImageMagick's PNG of this one came to 24.87 MB.

Resizing costs less than lowering the quality

At full size, quality 62 still came to 2.02 MB, so getting under 2 MB took quality 61, which scored 71.5. Half the width and half the height, a quarter of the pixels, gave 1.33 MB at quality 90 and scored 84.5.

Careful with that comparison. A resized file is scored against the resized picture, so 84.5 counts the compression damage and nothing the resize took away. The resize does take detail: 2040x1536 pixels is what's left.

Our call: unless the form asks for a minimum pixel size, send the smaller, cleaner picture. If it names one, check it before you shrink.

A 50-megapixel photo needs a bigger step

The second photo, from a Pixel 8 Pro, is 8160x6144 pixels and 13.06 MB. Iminify takes it without an account: it's under the 16 MB guest limit and the 64-megapixel ceiling. Smart gives it quality 90 at all three sizes we tried: above 36 megapixels Smart skips its search, and at half and quarter size, quality 90 still misses its target.

Step Pixels Size Score
Quality 90 8160x6144 8.57 MB 87.1
50% size, quality 90 4080x3072 3.08 MB 83.6
25% size, quality 90 2040x1536 1.02 MB 78.7

Smart alone gets it under a 10 MB limit. Half size clears 5 MB, and a quarter clears 2 MB with the same pixel count as the first photo at half size.

Is 5 MB 5,000,000 bytes?

Not always. A file just under the limit can still bounce. PHP counts 1M as 1,048,576 bytes, and its default upload limit is 2M, which is 2,097,152 bytes. A form that counts in round millions allows 2,000,000.

Our Windows 11 machine counts the way PHP does, 1,048,576 bytes to the MB: it shows the first photo as 6.23 MB.

The 50-megapixel photo at full size and quality 75 came to 5,048,553 bytes. Our machine shows that as 4.81 MB. PHP's 5M, 5,242,880 bytes, accepts it; a limit of 5,000,000 refuses it. Stay 5% under the number and the difference between the two units no longer matters.

Changing the DPI doesn't make the file smaller

The first result we got for "image too large to upload how to reduce" on 23 September 2026, a Canadian immigration help page, advises 96 DPI. That's advice for when you scan a document, where DPI decides how many pixels you get: 300 DPI across 4 inches is 1,200 pixels. On a photo you already have, DPI is a label.

We changed the first photo's DPI from 72 to 300. Same size, 6,535,144 bytes, and every pixel identical. We also re-saved the same pixels with 72, 96 and 300 DPI in Pillow 12.3, a different encoder from our tables, at quality 90. All three came to 5,654,734 bytes.

How we measured this

The 12.5-megapixel photo is Spring crocuses in Planina Dol by VlaDexa (CC BY 4.0), and the 50-megapixel one is Dyke Road Park Cafe, Hove by Andy Li (CC0), both from Wikimedia Commons as uploaded. As the app does, ImageMagick 7.1.2 converted the crocuses photo from Display P3 to sRGB and did the resizing. We then encoded with jpegli (commit 031a0077f579), the encoder Iminify uses for JPEG, with the 4:2:0 chroma it uses for photos; the same quality number means something else in other encoders. Scores come from ssimulacra2 (libjxl v0.12.0), and PSNR is computed over the RGB values the way Iminify computes it. The lossless repack is mozjpeg 4.1.5's jpegtran. These are our encodes, not files downloaded from Iminify, so the app's bytes can differ.

A photo for your own website is a different question, with a different answer: how many KB a website image should be.

Questions this post answers

Share this post

Share on X
Share on Facebook
Share on LinkedIn
Share on Reddit
Share on Hacker News
Email
Copy link
Link copied
Bar chart of the resized files WordPress 7.1.2 made on the server and in Chrome: 691 and 640 KB for a 1800 px photo, 1,942 and 2,193 KB for its 6000 px version, 553 and 651 KB for a PNG screenshot.

Does WordPress compress images? What WordPress 7.1 does to your upload

We uploaded the same photo to a fresh WordPress 7.1.2 site twice, both times from Chrome. The file we sent, 832 KB, was stored byte for byte both times. From it WordPress made five resized copies at JPEG quality 82. Through Media > Add Media File those copies came to 691 KB. Through the Upload button on an Image block they came to 640 KB, because in 7.1 that button has the browser make the copies instead of the server. So does WordPress compress images automatically? Not the file you upload, which is stored byte for byte. It re-encodes the resized copies it makes, the JPEG ones at quality 82. In our test a phone and a standard laptop screen downloaded copies of this photo, but a 2x laptop screen got the untouched original, so compressing it is still your job. Since 7.1, which program makes the copies depends on the button you press and the browser you press it in.

8 min read
Line chart of the fjord photo's SSIMULACRA 2 score over 100 saves: ImageMagick levels off at 91.99 and Pillow at 69.77, while Pillow with 1 pixel cropped before each save and jpegli after mozjpeg's decoder both fall below -60.

Does a JPEG lose quality every time you save it? We saved five photos 100 times

Two of the tests that come up for this question disagree. Fstoppers opened a photo in Photoshop 2020 and saved it 99 times at maximum quality, and saw "significant quality loss after you save it six times". Improve Photography saved one 30 times at maximum quality, painting a pixel white each time, and found "no noticeable reduction in image quality. None." Both judged by eye. We opened a JPEG 100 times, copied it and zipped it, then saved five photos 100 times in a row in five programs and scored every save against the file we started from. The short answer: Opening, copying and zipping never changed a byte. In every same-setting run, no later save cost as much as the first. Saving again at the same setting, with no edits, then mostly stopped costing: at their defaults, by save 73, ImageMagick, Chrome and Pillow were writing identical files on all five photos, and mozjpeg on four. Cropping one pixel or turning the photo before each save kept eating it. One pairing of two JPEG libraries lost quality with every save: the jpegli encoder fed by mozjpeg's decoder. Iminify runs that pairing, so we tested our own tool too.

7 min read
Bar chart of one photograph in bytes: 852,461 as served, against Lighthouse's target of 45,084 at its phone slot and encodes of 47,876 (JPEG), 46,320 (WebP) and 41,735 (AVIF).

Improve image delivery in Lighthouse: what it replaced and how it counts savings

PageSpeed Insights ran Lighthouse 13.5.0 on our home page on 22 September 2026 and flagged "Improve image delivery" in the mobile report: "Est savings of 1,300 KiB". All of it came from one photograph. The fjord shot in our before-and-after comparison is on the page twice, as the 832.5 KiB original and as our own compressed copy at 555.3 KiB. Both files are 1800x1200, and the report says they're displayed at 637x425. Three later runs that day said 1,359 KiB and 364x243. If your old notes say "Serve images in next-gen formats" or "Properly size images", this is where they went: Lighthouse 13 folded four image audits into this one insight. And its savings aren't measured: each figure is arithmetic on bytes and pixels. We reproduced every number in that insight, made the file it asks for, and traced one reason the same page gets two answers.

8 min read

Try it on your own images

Drop a photograph in, pick Smart, and compare the result with the original before you download. Free, no account needed.