Search code examples
c#.netimagetiffsystem.drawing

.NET Tiff Issues C#


I'm having issues with TIFFs

Here is what I have to do, we have tiff images saved into the database, these images are CCITT4 compressed with a number of required tags, these include:

RowsPerStrip must be the ImageLength

Photometric Interpreation must be MinIsWhite

Multi-strip image format is not allowed

My problem is, I'm using the built in System.Drawing.Bitmap/Image objects, which happen to change the values of these when I put it into the object, I've tested this by saving the byte[] to a tiff directly from the database, checked the tags, they are fine.. but when i put the bytes into an Image object then save to file, they are modified.

To make things worse, I'm needing to add a text to the image before saving it.

So I need a component that will allow me more control with TIFF (and they must be tiff), and be able to add text to an image or be able to use the Graphics object.

I've tried using LibTiff but I have yet to see any examples on how to use this component, any suggestions?


Solution

  • I have never used the built int System.Drawing.Bitmap objects to do this. I personally use LeadTools, but it isn't free. It is however a robust and fairly straightforward API. I primarily use it for GEOTiff which contain specific data tags for image location data.

    There is a 60 day evaluation if you would like to try it out.