C# TIFF Image Library
Convert Raster Images to TIFF in C#.NET


C# Demo to Convert and Render JPEG/Png/Bmp to Tiff in Visual C#.NET Project




C#.NET Image: Raster Images to TIFF Overview



To help C# developers to transform & convert various image forms, like Jpeg, Png, Bmp, and REImage object to single or multi-page Tiff image file with no loss in content quality. RasterEdge develops a C#.NET Tiff file converter control, XDoc.Tiff for .NET, which can be stably integrated into C#.NET developing projects, like ASP.NET web applications and .NET Windows Forms applications.



Use C# Code to Convert Jpeg to Tiff



Firstly, you may use following C# sample code to transform Jpeg image to Tiff image in your .NET application.




            String[] imagePaths = { @"F:\demo1.jpg", @"F:\demo2.jpg", @"F:\demo3.jpg" };
            Bitmap[] bmps = new Bitmap[3];
            // Step1: Load the image
            for (int i = 0; i < imagePaths.Length; i++)
            {
                Bitmap tmpBmp = new Bitmap(imagePaths[i]);
                if (tmpBmp != null)
                    bmps[i] = tmpBmp;
            }
            // Step2: Construct TIFFDocument object.
            TIFFDocument tifDoc = new TIFFDocument(bmps);
            // Step3: Other operations, like saving it.
            if (tifDoc == null)
                throw new Exception("Fail to construct TIFF Document");
            tifDoc.Save(@"F:\Test.tif");




Use C# Code to Convert Bmp to Tiff with specified compression type



The output TIFF file will be compressed by CCITT Group 3 Fax compression




            String[] imagePaths = { @"F:\demo1.bmp", @"F:\demo2.bmp", @"F:\demo3.bmp" };
            Bitmap[] bmps = new Bitmap[3];
            // Step1: Load the image
            for (int i = 0; i < imagePaths.Length; i++)
            {
                Bitmap tmpBmp = new Bitmap(imagePaths[i]);
                if (tmpBmp != null)
                    bmps[i] = tmpBmp;
            }
            // Step2: Construct TIFFDocument object.
            TIFFDocument tifDoc = new TIFFDocument(bmps,ImageCompress.Group3Fax);
            // Step3: Other operations, like saving it.
            if (tifDoc == null)
                throw new Exception("Fail to construct TIFF Document");
            tifDoc.Save(@"F:\Test.tif");




Use C# Code to Convert Bmp to Tiff with optional settings



The output TIFF will be 1.5 times the size of input image




            String[] imagePaths = { @"F:\demo1.bmp", @"F:\demo2.bmp", @"F:\demo3.bmp" };
            Bitmap[] bmps = new Bitmap[3];
            // Step1: Load the image
            for (int i = 0; i < imagePaths.Length; i++)
            {
                Bitmap tmpBmp = new Bitmap(imagePaths[i]);
                if (tmpBmp != null)
                    bmps[i] = tmpBmp;
            }
            // Step2: Create the ImageOutputOption object.
            ImageOutputOption option = new ImageOutputOption();
            //set the zoom value
            option.Zoom = 1.5f;
            // Step3: Construct TIFFDocument object.
            TIFFDocument tifDoc = new TIFFDocument(bmps, option);
            // Step4: Other operations, like saving it.
            if (tifDoc == null)
                throw new Exception("Fail to construct TIFF Document");
            tifDoc.Save(@"F:\Test.tif");