High quality JPEG compression with c#

后端 未结 6 2057
谎友^
谎友^ 2020-11-27 05:32

I am using C# and want to save images using JPEG format. However .NET reduces quality of the images and saves them with compression that is not enough.

I want to sav

6条回答
  •  旧时难觅i
    2020-11-27 06:02

    It looks like you're setting the quality to 100%. That means that there will be no compression.

    If you change the compression level (80, 50, etc.) and you're unsatisifed with the quality, you may want to try a different image library. LEADTools has a good (non-free) engine.

    UPDATE: As a commenter mentioned, 100% quality still does not mean lossless compression when using JPEG. Loading the image, doing something to it, and then saving it again will ultimately result in image degradation. If you need to alter and save an image without losing any of the data you need to use a lossless format such as TIFF, PNG or BMP. I'd go with compressed TIFF (since it's still lossless even though it's compressed) or PNG.

提交回复
热议问题