Omran
Omran

Reputation: 559

libtiff.net reading pixel data for image with 4 samples per pixel

currently I am trying to utilize libtiff.net library for processing digital Tiff images. but the image that i have is not with standard ones.

the image contains 4 samples per pixel and 10 bit per samples.

my question is: how to read the value of each sample of a pixel.

thanks in advance

Upvotes: 0

Views: 1034

Answers (1)

Bobrovsky
Bobrovsky

Reputation: 14236

Generally, there is no difference for the LibTiff.Net if you image is a 10 bits per sample or 8, or 16.

Some TIFF flavors can not be converted to RGBA using ReadRGBAImage method but the library should be able to decode them anyway.

Have a look at Basic introduction to the capabilities of the library article. It contains enough information about different approaches to reading images.

In you case you might want to use ReadScanline or ReadEncodedStrip / ReadEncodedTile methods. Using these you should get decoded image data and then it is up to you how you will interpret the data.

You might want to check byte ordering, too. If you don't, you might end up with color channels in wrong order.

Upvotes: 0

Related Questions