Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to improve the image quality while saving to jpeg. I have to read images from a .mht file. When i extract the image and save to a location the quality is poor. can we improve the quality of the image while saving.Please assist.

C#
image.Save(SourcesdirectoryPath + "\\" + "Image" + (i + 1) + ".Jpeg", ImageFormat.Jpeg);



Thanks in advance.
Posted
Updated 17-Mar-15 1:10am
v2
Comments
Herman<T>.Instance 17-Mar-15 7:11am    
which source gave you the .mht information?
Renjith_R 17-Mar-15 7:20am    
Thanks for the reply, I am getting the mht file from the PSR.
Sinisa Hajnal 17-Mar-15 7:28am    
What do you mean by improving quality? Are the images blurry, need sharpness or what? In general, you cannot improve the original image resolution, color depth etc...what do you need to do?
Renjith_R 17-Mar-15 7:52am    
The image which i get from PSR and taking a screenshot using printscreen button are different. My images looks blurry and its not clear compared to the actual screenshot.
BillWoodruff 17-Mar-15 7:58am    
Depending on how the .mht file was created there may be alternatives. You need to give the details on how the .mht file is created.

1 solution

I don't think it is possible,, sorry. Jpeg is a lossy compression format, it means that whenever an image is compressed, some informations in the original image are lost. You cannot recover the 'original' quality from the file.
There must be some algorithms that can act on smoothness, brightness, contrast, etc., and may result in a better sensation of quality; but that is not guaranteed, and the same algorithm could lead to an acceptable result for one image, and a non-acceptable for another one.
 
Share this answer
 
Comments
Sinisa Hajnal 17-Mar-15 8:44am    
My 5. Maybe you, Renjith_R, could change PSR options so that it uses better quality (less compression) for the images in MHT?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900