I need to resize an image, but the image quality cannot be affected by this.
相关问题
- Views base64 encoded blob in HTML with PHP
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- How to get the background from multiple images by
- Why am I getting UnauthorizedAccessException on th
See if you like the image resizing quality of this open source ASP.NET module. There's a live demo, so you can mess around with it yourself. It yields results that are (to me) impossible to distinguish from Photoshop output. It also has similar file sizes - MS did a good job on their JPEG encoder.
You can't resize an image without losing some quality, simply because you are reducing the number of pixels.
Don't reduce the size client side, because browsers don't do a good job of resizing images.
What you can do is programatically change the size before you render it, or as a user uploads it.
Here is an article that explains one way to do this in c#: http://www.codeproject.com/KB/GDI-plus/imageresize.aspx
Unless you're doing vector graphics, there's no way to resize an image without potentially losing some image quality.
I believe what you're looking to do is "Resize/Resample" your images. Here is a good site that gives instructions and provides a utility class(That I also happen to use):
http://www.codeproject.com/KB/GDI-plus/imgresizoutperfgdiplus.aspx
Here is a forum thread that provides a C# image resizing code sample. You could use one of the GD library binders to do resampling in C#.