Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Dear all,

In vb.net i tried to compress image file.using Rijndael algorithm i have encrypt the file.after encryption the file size will be the same as original..is it posible to get the file with less size compared to original?

if it is possiblel means which algorithm suits for that?

thanks in advance

Posted

The chances are that you can't compress an image sifgnifcianly, unless you atart with an uncompressed image format such as a Bitmap. Most image formats already involve some form of compression, and compressed data is (understandably) difficult to compress again - or we would just repeat the compression until we got to every file occupying 16 bytes.

In fact, compressing images (and other compressed file formats) may actually increase the size of the resulting files due to the added overhead of the compression support data.

Don't you think that if you could compress images using standard techniques such as Rijndael someone would not have added it to browsers to speed display? :laugh:
 
Share this answer
 
Comments
jai_mca 2-Nov-12 4:54am    
yes..i used it.but it doesn't reduce the size after encryption.so there is no possibility to attain small size after encryption?
OriginalGriff 2-Nov-12 5:05am    
Almost certainly not, unless you start with an uncompressed image format in the first place.
jai_mca 2-Nov-12 5:18am    
sorry to ask this,uncompressed image format in the sense?
OriginalGriff 2-Nov-12 5:24am    
Bitmap files (*.BMP) are uncompressed. JPEG and GIF, and PNG, and TIF are all compressed in one way or another.
(This is one of the reasons that they are smaller than the equivalent BPM file!)
What formats are you working with?
jai_mca 2-Nov-12 5:30am    
i am working with JPEG format
I hardly believe you can.
However, you may try a lossless compression algorithm (like the one used in ZIP files, for instance).

You might use the opposite approach: first compress and then encrypt.
 
Share this answer
 
Comments
jai_mca 2-Nov-12 4:11am    
dear CPallini
compress and encrypt also remains the same size
CPallini 2-Nov-12 4:50am    
If you have an already compressed image (like, for instance, a JPEG one) then you have few chances to compress it further.

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