views:

119

answers:

4

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?

+1  A: 

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.

jsmith
Doesn't need to be free, but I need at least a trial to see if it doesnt what i need it to do
LeeHull
+1  A: 

You can use our free and open-source LibTiff.Net library for this. It is freely available for all uses under a BSD license. The just released version 2.0 contains good documentation and number of samples.

There are samples that show how to convert any non-tiled TIFF image to the TIFF image which have all data written in a single strip and how to convert a System.Drawing.Bitmap to 1-bit CCITT single strip TIFF image.

Bobrovsky
works well for me!
Adriaan
A: 

I use FreeImage. There's a C# .NET wrapper available too.

Keith
A: 

The IEvolution component set from HiComponents is now totally free (no source) - http://www.hicomponents.com. A very powerful .NET imaging toolkit.

Keith Blows