Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone .
I am using the bitmap class for manipulating images changing their pixel values.
But the problem is SIZE of the image.
Is there any method to reduce the size of a bitmap image without changing their pixel values.
JPEG Images has got less size .Is there any class provided to edit the JPEG pixel values ???

Thanx in advance.. :-O
Posted

JPEG files are smaller because the image is compressed, so...the pixel values are changed. If you take a straight-up bitmap and convert it to (save it as) a JPEG, you are changing the pixel values.

There are two ways to make a bitmap file size smaller: resize the image or compress it.

When you load a JPEG into memory with the Graphics/Bitmap/Image classes in .NET you can do everything to that JPEG that you can to a bitmap image. Once you load the JPEG into memory, the .NET framework decompresses the image and you have access to the bits.

See here: http://www.codeproject.com/KB/GDI-plus/GDI_.aspx[^]

Or here: Bob Powell[^]

Cheers.
 
Share this answer
 
Comments
Be Yourself 18-Oct-10 10:16am    
Thanks the post was helpful.
Is there any method to manipulate the jpeg image pixels directly as they are stored in hard disk???
TheyCallMeMrJames 18-Oct-10 17:24pm    
No, unfortunately you can't edit jpeg image pixels directly, as JPGs aren't saved as pixels, per se. You can save the images as JPGs, but when you want to work with them (in memory) you need to decompress them to bitmaps and work with THAT to access the pixels. Hope this helps.
Be Yourself 19-Oct-10 3:42am    
Thanks a lot for Ur help..
There is no built-in method to do this in the .NET Framework the way you want. Everything is handled as a full, 32-bit BMP (you might say BMP) uncompressed image in memory.

You'll need some kind of 3rd party library that handles JPG editing the way you want. I don't know of any off the top of my head.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900