c# - Basics in Resizing Pictures or What happened to Picture Size? -
I am writing a program that resizes the image in such a way:
Image original image = image fromFile (pathToOriginalPicture); Bitmap b = new bitmap (nudity, newhigh); Graphics G = Graphics. Framesize (b); G.DrawImage (Original Image, 0, 0, Nudity, NewHead); G.Dispose (); B Save (pathtoau output image, image format. Jpeg);
I tried to set:
newWidth = originalImage.Width; NewHeight = Original Image. height;
The result was that the photo of the resize was created, whereas the original file was ~ 4M.
Why is this happening? Is the quality of the original picture better than the re-size? how?
I opened both photos in Photoshop and I think the original picture was 72 pp, while a resized person became 96 pp. Why is it like this ? Can you control it?
Thank you very much for your time!
Do not tell us the original form of your photo, but saving you as a JPEG :
b.Save (pathToOutputPicture, ImageFormat.Jpeg);
In addition to lossy, JPEG can also output different quality (which is configurable).
This is happening on your file size: it is shrinking because you lost the lossy JPEG to a lossless format or say, because you went to JPEG with a low-quality JPEG.
Therefore decrease in size
Comments
Post a Comment