4

When I save my image for the web in Adobe Photoshop, the produced jpeg is larger than the original jpeg file. The only alteration done to the image is cropping.

How is this possible? I am saving the jpeg at 30 quality.

1
  • Yes its entirely plausible. The tech behind compression is not linear in nature. Bigger images compress better. Compression on compression is also problematic. So learn from this that your internal worldview is not always correct. real world stuff have all kinds of nasty corner cases.
    – joojaa
    Apr 25, 2015 at 13:44

1 Answer 1

11

Although the question was asked about Adobe Photoshop, the behavior is due to the lossy JPEG format and would be similar with any image editor.

Cropping a JPEG can make it less compressible, especially when the x and y offsets of the cropped area are odd numbers. This causes a re-subsampling of the color channels that can make the cropped image more complex and thus less compressible.

Also if the cropping offsets are not divisible by 8, the 8x8 tiles used in JPEG compression are now made up of parts of several adjacent tiles from the original JPEG, and that can increase the image complexity.

There are other things that can come into play (addition of a color profile, etc.) but without access to your before-and-after images it's hard to tell what exactly happened. Most likely, though, it's the cropping offset effect described above.

Results would depend upon the nature of the image. I experimented with a 500x500-pixel checkerboard of 100x100-pixel squares, compressed with quality 50, then cropped to 490x490 pixels and recompressed with quality 50.

The resulting sizes are:

original:                     3968 bytes
cropped with 1-pixel offsets: 5445 bytes
cropped with 2-pixel offsets: 5279 bytes
cropped with 3-pixel offsets: 5481 bytes
cropped with 4-pixel offsets: 4426 bytes
cropped with 8-pixel offsets: 3917 bytes

For a photograph, on the other hand, results are more in line with intuition, the cropped photo having a slightly smaller file size than the original:

comressed with quality 50:    57413 bytes
cropped with 3-pixel offsets: 56576 bytes
cropped with 4-pixel offsets: 56170 bytes

I used ImageMagick, not Photoshop, for these experiments, but I'm sure that Photoshop would exhibit similar behavior for these tests.

2
  • What sort of difference might it be (a small change, doubled, order of magnitude etc)
    – Yorik
    Apr 24, 2015 at 14:20
  • @Yorik, see the examples in my answer. Apr 25, 2015 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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