Click here to Skip to main content
15,897,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to programatically delete some pixels that are unused in order to reduce the image size.


Can anyone tell me how to reduce the size of an bitmap image file without changing the pixels values.. (i.e the RGB Components)
Posted
Updated 13-Oct-10 3:50am
v2
Comments
Kschuler 13-Oct-10 9:50am    
Edited question - I removed the code block since it wasn't code. Makes it easier to read.

1 solution

In order to reduce image the size (on the storage medium) you may just compress it (for instance using jpeg file format).
:)
 
Share this answer
 
Comments
Be Yourself 13-Oct-10 4:34am    
But JPEG Format will change the pixels RGB values as it was in bmp file.
I want to retain the RGB Values and remove some unused pixels to reduce the size can u suggest anything..
Be Yourself 13-Oct-10 4:36am    
I have tried the method U R thinking and I got the problem plz suggest any other method
CPallini 13-Oct-10 4:38am    
You may use lossless compression (even jpeg lossless compression). What do you mean with 'unused pixels'? As far as I know there aren't 'unused pixels' in a image.
Be Yourself 13-Oct-10 4:48am    
Actually I am manipulating with pixels.
Suppose I have an Image of Size (10x10) there are 100 pixels and I have used 50 pixels whose RGB values I have fixed according to my requirment.
Now I want to delete the last 50 pixels that I have not at all used to set their RGB values.
CPallini 13-Oct-10 4:55am    
If the 'unused' pixels are sparse, then you cannot do much (you may, for instance, set them to black and rely on, already mentioned, lossless compression). If the most of the image pixels are 'unused' then you may code your own file format, saving just the info about the 'used' pixels.

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