Hi,
I write a program that resize pictures like this:
Image originalImage = Image.FromFile(pathToOriginalPicture);
Bitmap b = new Bitmap(newWidth, newHeight);
Graphics g = Graphics.FromImage(b);
g.DrawImage(originalImage, 0, 0, newWidth, newHeight);
g.Dispose();
b.Save(pathToOutputPicture, ImageFormat.Jpeg);
I tried to set:
newWidth = originalImage.Width;
newHeight = originalImage.Height;
The result was that the rezised picture file became ~900K while the original file was ~4M.
Why this is happening ?
Is the quality of the original picture better than the resized one ? In what ?
I opened both pictures in Photoshop and I see that the original picture was 72ppi, while the resized one became 96ppi. Why is that ? Can I control this ?
Thanks a lot for your time !
Hi,
Thank you very much for your answers !
I don't really want to "resize" to the original size.
That was just an example.
Actually, I write a program that resizes pictures to the desired size (width and height in pixels).
I've noticed that even if the picture size decreases a little, the file size decreases very much. I just want to understand why.
Then I tried to "resize" to the original size, and saw that the file size become pretty little. This is really strange to me !
I still don't understand whether the output picture in this case is worse than the original picture.
In my program I'm interested to resize JPEG pictures in order to send them by email. I know that there are many programs that do that, but I want to write my own program.
Could you suggest how to resize JPEGs such that the output picture will be with highest quality ?
Thanks !