changing image resolution in C#.NET
-
I wish to convert a 96dpi image to a 300dpi image in .NET... Here's the code I currently use: // iMage is the original 96dpi image int iNht=(iMage.Height*300)/96; int iNwd=(iMage.Width*300)/96; Bitmap bMap=new Bitmap(iMage,iNwd,iNht); bMap.SetResolution(300,300); iMage=bMap; The code works fine, but there's one problem - the 300dpi image is of poor quality (appears kinda faded)... Time is of concern, so I'm avoiding needing to write my own resize method... But the poorer quality is also not acceptable!! :( Any ideas?? Thanks!!
-
I wish to convert a 96dpi image to a 300dpi image in .NET... Here's the code I currently use: // iMage is the original 96dpi image int iNht=(iMage.Height*300)/96; int iNwd=(iMage.Width*300)/96; Bitmap bMap=new Bitmap(iMage,iNwd,iNht); bMap.SetResolution(300,300); iMage=bMap; The code works fine, but there's one problem - the 300dpi image is of poor quality (appears kinda faded)... Time is of concern, so I'm avoiding needing to write my own resize method... But the poorer quality is also not acceptable!! :( Any ideas?? Thanks!!
You are not only changing the resolution, you are also resizing it. As you enlarge it to more than three times the original size, of course the image quality will be bad. Even if the image is larger, there still isn't any more detail information than in the original image. If the image looks faded and not pixly, the resize is most likely using the bicubic method. It's the best you can do with conventional methods. If you wan't a better resizing method you might look up something called Genuine Fractals. --- b { font-weight: normal; }
-
You are not only changing the resolution, you are also resizing it. As you enlarge it to more than three times the original size, of course the image quality will be bad. Even if the image is larger, there still isn't any more detail information than in the original image. If the image looks faded and not pixly, the resize is most likely using the bicubic method. It's the best you can do with conventional methods. If you wan't a better resizing method you might look up something called Genuine Fractals. --- b { font-weight: normal; }
-
You are not only changing the resolution, you are also resizing it. As you enlarge it to more than three times the original size, of course the image quality will be bad. Even if the image is larger, there still isn't any more detail information than in the original image. If the image looks faded and not pixly, the resize is most likely using the bicubic method. It's the best you can do with conventional methods. If you wan't a better resizing method you might look up something called Genuine Fractals. --- b { font-weight: normal; }