isana
isana

Reputation: 11

How can I get the point pixel values to an array from Tiff using C#?

I want to read the pixel values from Tiff images.

I have seen a similar question, but I still have no idea how to deal with normal Tiff images.

Upvotes: 1

Views: 1867

Answers (1)

Orace
Orace

Reputation: 8359

In the samples of the libtiff.net github repository, there is one called ReadSamples and the documentation states:

This sample shows how to read RGB value of any pixel in a TIFF image.

The library provides methods that can decode almost any TIFF image and return array of packed RGBA values for its samples (pixels). This sample shows how to use Tiff.ReadRGBAImage method to get packed sample values and Tiff.GetA/GetB/GetG/GetR to unpack individual components of an RGBA value.

The code is based on ReadRGBAImage, Tiff.GetR, Tiff.GetG and Tiff.GetB methods from the libtiff.net library.

Upvotes: 1

Related Questions