I need to save several files as 20mb jpgs. When I save an image in Photoshop CS5 at 20mb, then go to that saved file in my folder, it shows as a much smaller file. Is there a formula for hitting that target size? A ratio?


JPEG file size is a meaningless measure, except as an optimization criterion for bandwith/diskspace considerations.

Since JPEG is optimized to compress areas with little detail, while preserving fine detail, compression is dependent on the details in the image. There is no way you could produce a 20mb file from eg. a plain white image, no matter the dimensions for any reasonable photo dimensions. On the other hand, a large image with a lot of fine detail will produce a large JPEG file when saved with a good quality setting.

So, in my opinion, you should review your requirements. There aren't a lot of reasons to require a specific JPEG file size, most often, you only need to respect a maximum size. To achive this, the "save for web" function offers a suitable option.

  • Great answer overall, but to be pedantic the statement "There is no way you could produce a 20mb file from eg. a plain white image, no matter the dimensions" is not true. JPEG divides the image up into 8x8 or (16x16) blocks for compression. It has to store some data per block even if there's no detail. The maximum dimensions supported by the JPEG format are 2^16 - 1. Creating a 65535 x 65535 plain white image in Photoshop and saving as a JPEG resulted in a 272MB file. You could go even larger using the progressive option, but I didn't have enough memory available to perform that operation! – Matt Grum Mar 17 '15 at 9:41
  • 2
    -1 for "JPEG file size is a meaningless measure." If I'm shoving it out over a mobile or other low bandwidth network it's incredibly relevant. – Philip Kendall Mar 17 '15 at 10:37
  • 2
    it's meaningless to require a specific file size. "as low as possible while maintaining visual quality" is of course different. – ths Mar 17 '15 at 10:40
  • 1
    @PhilipKendall If you read the whole answer it's clear ths is referring to minimum filesizes as being a meaningless measure. – Matt Grum Mar 17 '15 at 11:23
  • +1 for "JPEG file size is a meaningless measure" as this case is posted. Maximum file size, yes, that have sense. – Rafael Mar 17 '15 at 16:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.