Reputation: 74
I was asking myself, why the size of my original tiff is increasing (from 992KB to 9,42 MB), when i save it with Bitmap.Save(). The question came up, because i currently work with tiffs, modifiy them and so on.
I saw two differencen between the files (besides the file size).
Is one of these properties the cause of the tenfold size increase?
This is the code i use:
Bitmap bmp = new Bitmap(@"C:\Users\PJ.ITAMS\Deskto\originalTiff.tif");
bmp.Save(@"C:\Users\PJ.ITAMS\Desktop\savedTiff.tif",ImageFormat.Tiff);
bmp.Dispose();
If anything is unclear or i gave too little information i'm sorry and give you everything you ask for! Thanks in advance.
Upvotes: 3
Views: 4301
Reputation: 441
The file size is larger Because you didn't specify a compression. This way the file is saved as an uncompressed tif.
The save Function of the Bitmap class is also overloaded with a function that takes EncoderParameters as an argument. This is how you control compression.
you can find more information here: MSDN documentation of Image.Save (The Bitmap Class implements Image)
Upvotes: 1