Converting TIFF files to PNG in .Net

后端 未结 2 1105
情书的邮戳
情书的邮戳 2020-12-08 15:57

I have to build an application in .Net (3.5) to pick up a TIFF file saved from another piece of software and convert it into a PNG so that it can be rendered easily in Inter

相关标签:
2条回答
  • 2020-12-08 16:04
    System.Drawing.
        Bitmap.FromFile("your image.tif")
                  .Save("your image.png", System.Drawing.Imaging.ImageFormat.Png);
    

    Please, also check this: Convert Tiff Images to Gif/Jpeg

    0 讨论(0)
  • 2020-12-08 16:21

    In C# / .NET, it is probably as easy as:

    using System.Drawing;
    using System.Drawing.Imaging;
    
    using (var tiff = new Bitmap("my_tiff_file.tif")) {
        tiff.Save("output.jpg", ImageFormat.Jpeg);
    }
    

    If for some reason System.Drawing.Imaging won't read your TIFF files, check out an open-source project called ImageMagick, which will read and write just about any image format imaginable. Worst case scenario you'll need to call ImageMagick's convert.exe via Process.Start() in .NET - not elegant, but it does work.

    0 讨论(0)
提交回复
热议问题