Using LibTiff from C# (to access tiled TIFF images)

Adriaan picture Adriaan · Jan 11, 2010 · Viewed 19.1k times · Source

I'd like to use LibTiff to access very large TIFF files. I need functions like multiple pages and tiles, and so LibTiff seems to be the right way to go. Can anyone help me on how to use LibTiff from C#? I've found some links (like blog.bee-ee which contained partial code. But I couln't get beyond getting a version. I've looked at FreeImage but found it not suitable (pictures are approx. 800 MPixel 8 or 16 bit grayscale --> 800-1600 MByte) size and I can't load it in memory in a 32-bit environment)

I'm very experienced in C/C++, but not yet in C#. Can anyone help me to a wrapper or some hints?

Note: I need pages to access pyramidical planes (multi-resolution) in a tiff, and tiles of 256x256 to have fast access to different parts of the image without loading it at once.

[Edit] The LibTIFF.NET solution seemed most practical for me. I'm now integrating it in a product development, and it will propably save me a lot of headaches from going in/out of managed memory. I have not yet tried the 'callback' functionality, which seems to be solved nicely in a .net way. Thanks for the help on stackoverflow [/Edit]

Answer

Bobrovsky picture Bobrovsky · Jan 13, 2010

You can try our LibTiff.Net. It is free and open source version of LibTiff written using managed C#. API of our implementation kept very similar to original one's.

https://bitmiracle.com/libtiff/

We've just released it, so there may be bugs. But full source code comes with a number of test, so most obvious bugs should be fixed.