Converting TIFF files to PNG in .Net

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 Internet Explorer. Does anyone know of any libraries (preferably freeware/open source) that will do this conversion for me?

If there aren't any simple ways of getting it to a PNG are there any libraries that I can use to transform it to another IE friendly image format?

I know I can pass a TIFF to the browser and use a plugin to render it but the PCs this is aimed at are locked down and can't install plugins.

Answers


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


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.


Need Your Help

ASP.Net httpruntime executionTimeout not working (and yes debug=false)

asp.net httpruntime executiontimeout

We just recently noticed that executionTimeout has stopped working on our website. It was definitely working ~last year ... hard to say when it stopped.

How to deal with the sum of rounded percentage not being 100?

ruby rounding

Suppose we have a list of items with an integer: