Optimizing file size of an image?

  • Thread starter Thread starter slavinger
  • Start date Start date
S

slavinger

Hi,

Got an interesting problem here: I'm using C# to resize an image
(jpeg) from over 2000x1700 (in pixels) to 550x412. When I save the new
image, its file size ends up being in the neighborhood of 550K. When I
use a graphics editor app, it produces a similar quality 550x412 jpeg
that's only 40K in size. What can I do in C# to cut down on resulting
image's file size? Thanks!
 
Got an interesting problem here: I'm using C# to resize an image
(jpeg) from over 2000x1700 (in pixels) to 550x412. When I save the new
image, its file size ends up being in the neighborhood of 550K. When I
use a graphics editor app, it produces a similar quality 550x412 jpeg
that's only 40K in size. What can I do in C# to cut down on resulting
image's file size? Thanks!

I've never tried it, but I suspect that using the version of Image.Save
that takes and ImageCodecInfo and EncoderParameters is the way - just
set an appropriate parameter to specify the quality and turn it down a
bit.
 
Jon said:
I've never tried it, but I suspect that using the version of Image.Save
that takes and ImageCodecInfo and EncoderParameters is the way - just
set an appropriate parameter to specify the quality and turn it down a
bit.

Thanks Jon, I'll give it a try. I just turned resolution down a bit
(to 72x72 dpi, equal to what the editor app is producing), and it made
no difference whatsoever on image quality and file size. Makes me
wonder if the resolution API is working at all, besides setting the
attribute in file header.
 
Thanks Jon, I'll give it a try. I just turned resolution down a bit
(to 72x72 dpi, equal to what the editor app is producing), and it made
no difference whatsoever on image quality and file size. Makes me
wonder if the resolution API is working at all, besides setting the
attribute in file header.

The resolution is likely to make no odds at all - I think it's just
informational, so that programs which need to print the image know how
to scale it appropriately.
 
Slavinger,
I have been trying to do this for a couple of weeks and could not figure out
how to save the resized image. Would you provide info on how you are
resizing and saving the new image in c#?

THanks,
Evan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top