Convert different picture formats (jpg, gif, png, etc.) to TIFF format

user1509 picture user1509 · Aug 7, 2012 · Viewed 37.6k times · Source

I am working on reading text from an image through OCR. It only supports TIFF format images.

So, I need to convert other formats to TIFF format. Can it be done? Please help by providing some references.

Answer

Jacob picture Jacob · Aug 7, 2012

If you create an Image object in .NET, you can save it as a TIFF. It is one of the many ImageFormat choices at your disposal.

Example:

var png = Image.FromFile("some.png");
png.Save("a.tiff", ImageFormat.Tiff);

You'll need to include the System.Drawing assembly in your project. That assembly will give you a lot of image manipulation capabilities. Hope that helps.