2017.06.09 18:41 "[Tiff] Read and interpret 16 bit strip data with geo tiff", by Felipe Brubeck

2017.06.09 18:58 "Re: [Tiff] Read and interpret 16 bit strip data with geo tiff", by Bob Friesenhahn

Opening the image in matlab and checking the first four pixels (bottom-left) in each channel I got 291, 428, 444 and 1473, which doesn't seem to be anything on the p0 value I'm getting.

I don't know if it's because of the 12-bit resolution, or if I have to convert it to a type other than uint32, but I just can't make sense of that number.

Can somebody please give me some pointers on how to handle the image data to store it and manipulate it, and to decipher this number and if it corresponds to the first four pixels in the bottom left corner?

The data will be 16-bit sample values in native byte order in RGB order which means that it will depend on the type of CPU you are using.

One way to access the data is to cast it (the unsigned char *) to a 'uint16_t *' and then access it as an array of 16-bit values.

   uint16_t * p16;

   p16 = (uint16_t *) buff;

   printf("%u\n", p16[0] >> 4);
   printf("%u\n", p16[1] >> 4);
   printf("%u\n", p16[2] >> 4);

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/