c# - Lossless optimization of JPEG with FreeImage -


There are several tools to optimize JPEG without sacrificing quality, such as I and this code (preferably in .NET ) And I am currently living but I am not getting the result which I want.

A JPEG_OPTIMIZE flag but you have to set a quality flag and then it will no longer be defective.

This is what I have done:

  var image = FreeImage Load (FREE_IMAGE_FORMAT.FIF_JPEG, file in, FREE_IMAGE_LOAD_FLAGS.JPEG_ACCURATE); Free image Save (FREE_IMAGE_FORMAT.FIF_JPEG, image, fileout, FREE_IMAGE_SAVE_FLAGS.JPEG_OPTIMIZE);   

But it does a compression. I thought FreeImage could optimize (by erasing metadata etc.), but I do not know how to keep the same compression / image quality. What is the proper way to do this?

EDIT: There is some confusion about not being able to adapt JPEG, the short answer is yes you can because you can remove the unused metadata I can compress Check out these threads or check Michael B's answer.

The question is: can this be done with FreeImage, and if so:

I think that FreeImage only supports lossless changes Image_jpgGenanceForm ).

This can save in different files, but unfortunately there is no way to save any flag on new file to allow metadata to be snatched.

I can only suggest that you can see the source to see if there is something that you can use yourself.

Comments