Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resizing an Image without losing any quality [closed]

How can I resize an image, with the image quality unaffected?

like image 992
public static Avatar asked Sep 17 '08 21:09

public static


People also ask

What type of image can you resize without losing its quality?

The best Photoshop method to resize images without losing quality is through Perfect Resize. Perfect Resize automates the resampling process with extreme ease of use, giving you a perfect resized image with the same level of quality. To use Perfect Resize, first, open the resize image in the application.

Does resizing an image reduce quality?

If you double the size of an image, the resolution decreases by half, because the pixels are twice as far apart to fit the physical size. For example, a 400 x 400-pixel image, has a physical size of 4 x 4 inches and has a resolution of 100 pixels per inch (ppi).


1 Answers

As rcar says, you can't without losing some quality, the best you can do in c# is:

Bitmap newImage = new Bitmap(newWidth, newHeight); using (Graphics gr = Graphics.FromImage(newImage)) {     gr.SmoothingMode = SmoothingMode.HighQuality;     gr.InterpolationMode = InterpolationMode.HighQualityBicubic;     gr.PixelOffsetMode = PixelOffsetMode.HighQuality;     gr.DrawImage(srcImage, new Rectangle(0, 0, newWidth, newHeight)); } 
like image 154
Kris Erickson Avatar answered Oct 12 '22 13:10

Kris Erickson