2

I'm working on an MVC 3 website with an Admin section that allows the client to add their own images. By "optimize" I mean compressing the image file so that it's a smaller size without a noticeable difference in quality, similar to what this tool does:

http://www.imageoptimizer.net/Home.aspx

That tool looks like it would work great for integration, but it costs money.

Here's another tool, and it's free, but the problem with this one seems to be that it requires you to actually embed it into your webpage:

http://www.webresizer.com/app/

So my question is:

Does anyone know of any free 3rd-party tools for image optimization that can be run dynamically in an MVC 3 website that wouldn't require you to embed it into a web page?

I know that's a lot of requirements, so if there aren't any tools out there like that, the next thing I would like to ask is:

Are there any good examples out there of image compression algorithms that we could write ourselves?

Any help is greatly appreciated.

schplade
  • 21
  • 1
  • 2
  • I doubt that these "image optimizer" do a lot of magic. The mainly resize the image so that no more the needed size is stored and they recompress the image with a higher JPEG compression rate. Both can be easily achieved with standard .NET classes. Additionally they might apply a filter to reduce the noise in the image and allow for better compression. Have you tried to just resize the uploaded image and save it as a JPEG with compression rate for average quality? – Codo Jul 30 '11 at 08:39

1 Answers1

0

Use GZIP to compress the images. You can configure this in the web.config

See the answer how to do so here: Enable IIS7 gzip

Community
  • 1
  • 1
Oved D
  • 7,132
  • 10
  • 47
  • 69
  • 4
    GIF, JPEG and PNG all use compressio already. An additional GZIP compression will shrink the images by at most 1%. It just adds complexity and waste CPU cycles. – Codo Aug 02 '11 at 17:45
  • we are looking for image compression (like .jpg gif, png etc.,).IIS settings can only compress js and css files. Is there any configuration to compress images? – mmssaann Jan 28 '14 at 11:53