Image size got bigger when trying to reduce its size

前端 未结 2 996
情话喂你
情话喂你 2020-12-21 19:52

I am trying to resize a pic of format jpg, reduce it\'s resolution in order for it to be smaller when I download it to the site HTML. Using the tutorial in the link: image r

相关标签:
2条回答
  • 2020-12-21 20:02

    If a JPEG image file is getting bigger when you are reducing the dimensions, it's because you are saving it with a higher quality setting than the original.

    0 讨论(0)
  • 2020-12-21 20:09

    This is quite normal when you use a compressed image format like jpeg. It is caused by the filter you selected when you reduced the image size. A default selection for the Graphics class, for example, is InterpolationMode.Bilinear. Which does a pretty nice job of making a good looking shrunk version of the image. But at a cost of adding a lot of extra colors to the image due to the filtering algorithm. The resulting image won't compress as well as the original and can in fact require more storage.

    You'd have to pick a lower quality filter to avoid this, like InterpolationMode.NearestNeighbor. Yes, won't look nearly as good. In general you should avoid re-compressing an image that was already compressed in a lossy format like jpeg.

    0 讨论(0)
提交回复
热议问题