![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Hi, I want to save a multi TIFF. In my test I have found out that the method Image.Save() cannot save a multi TIFF: Image image = Image.FromFile( "Zahlen_1-20.tif" ); image.Save( "MultiTIFF.tif" ); image.Dispose(); So I create now a new Image, add each frame of the multi TIFF and save the new image. This works fine, but the size of the new multi TIFF is now about 450 KB instead of 65 KB. Image image = Image.FromFile( "Zahlen_1-20.tif" ); int frameCount = image.GetFrameCount( FrameDimension.Page ); for ( int frameIndex = 0; frameIndex < frameCount; frameIndex++ ) { byte[] frame = GetFrame( image, frameIndex ); // How must I add here the frame to a new multi TIFF Image, so the size of the new image is about 65 KB ? // The compression should be LZW. } public byte[] GetFrame( Image image, int frameIndex ) { using ( MemoryStream stream = new MemoryStream() ) { image.SelectActiveFrame( FrameDimension.Page, frameIndex ); image.Save( stream, ImageFormat.Tiff ); return stream.ToArray(); } } How can I save the multi TIFF so it has the same size as the original? Thanks, Heinz |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |