Can C# read geoTiff file?

F

FrankMeng

When I tried

pictureBox1.Image = Image.FromFile("aGeoTiffFile.tif");

I got an error:
System.Exception: A Graphics object cannot be created from an image
that has an indexed pixel format.

Can I load geoTiff file and access its meta info with C#?
 
N

not_a_commie

TIF supports a lot of random meta data that may or may not be
supported. If all you care about is the image itself, you should run
your images through a batch converter that supports that particular
variety of TIF and convert them to something more standard like PNG.
Otherwise you'll have to use a third party library built for such.
I've used ImageMagick before and liked it, though it may not support
all strange TIF data either. I would assume the defaykt C# library
would struggle with nonstandard indexing schemes as well as 16bit
channels. My guess is that they would handle an 8bit indexed TIF but
not a 12bit indexed TIF, etc.
 
M

Michael Phillips, Jr.

System.Exception: A Graphics object cannot be created from an image
that has an indexed pixel format.

Not supported with System.Drawing.Imaging(i.e., .Net 1.1, 2.0 )

It is supported by System.Media.Imaging(i.e., .Net 3.0 )
 
G

Guest

If you search around, you can find some TIFF Image processing libraries for C#.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top