为什么图片裁剪后尺寸会变大

原文地址:http://graphicdesign.stackexchange.com/questions/51631/why-does-a-jpegs-file-size-increase-after-cropping-and-saving-for-web-in-photosh


8
down vote accepted

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.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值