Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting bmp to jpg - Compression?

0 views
Skip to first unread message

I Am Cup [NOT an MVP]

unread,
Jul 12, 2002, 2:33:45 PM7/12/02
to
I originally posted this in the win forms group, but didn't get any
responses. Figured that someone in here might know what to do:

I have a bitmap that I want to convert to a jpg. I do this with the
following code:

oBitmap.Save("c:\\pic\\test.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);

The bmp file from which I created my bitmap object weighed in around
380k. Oddly enough, the jpg created from the above bit of code is also
about 380k. Call me crazy, but it seems to me that saving to jpg format
really ought to lower the size of the resulting image file.

Is it not really saving in jpg format, or is the .NET framework's jpg
scheme just not terribly efficient? Is there a way that I can have finer
control over the output size (perhaps by controlling the output quality)?

Thanks.

I Am Cup [NOT an MVP]

unread,
Jul 12, 2002, 2:38:29 PM7/12/02
to
Never mind.

Found the answer in the drawing group...

Nicholas Paldino [.NET/C# MVP]

unread,
Jul 12, 2002, 2:37:23 PM7/12/02
to
I Am Cup [NOT an MVP],

When you are using the bitmap, I believe it is storing the information
in 32 bits per pixel. While I know that JPGs use compression, I believe
that it is trying to store 32 bits of information per pixel (or at least
compress that much) compared to the typical 8 bits per pixel which is
expected by most formats (gif, jpg, etc, etc).

I'm not sure if that is the issue, but I hope it helps.


--
- Nicholas Paldino [.NET MVP]
- nicholas...@exisconsulting.com


"I Am Cup [NOT an MVP]" <iam...@thetable.com> wrote in message
news:3D2F2109...@thetable.com...

0 new messages