Click here to Skip to main content
16,013,548 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to images compress in C# (image like jpg,png)
Posted

JPG and PNG images are already compressed, so you can't reduce file size appreciably further unless you are prepared to lose image quality.

The Image.Save method calls GDI+ function GdipSaveImageToFile [^]with the encoderParams parameter set to null, which equates to 75%. You could use the function directly, supplying a "proper" parameter and change that to get a smaller file size, but the quality will suffer.
 
Share this answer
 
Comments
Thomas Mahoney 14-Jul-17 16:31pm    
Not true, Many PNG's might be 900 kb can be compressed 100 kb without lose using Paint.net or other programs.
Just change the path which you re giveing in the default page...this can be a permission issue...
 
Share this answer
 

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