I just had a look at the code and also added some debugging code to confirm
exactly what is going on.  QImage can handle bit depths greater than 8
bit/channel and defaults to a pixel bit depth of 32 (which is really 10
bit/channel).   This is also the max bit depth it supports.  The constructor
for QImage is:

QImage::QImage ( int w, int h, int depth, int numColors = 0, Endian bitOrder =
IgnoreEndian )

Where depth can be 1, 8, 16 or 32.

When I print out image.depth() for the QImage being used by the picker it is
32 bits.  But in the loop that is picking the values if I filter out all rgb
values < 255 I don't get anything.  So QImage is effectively remapping the 16
bit/channel image as an 8 bit/channel image.

This would explain my previous post about linear vs. gamma-corrected input. The linearly-derived profile was much worst fit and exhibited the banding. I (wrongly) assumed that because lprof could now load TIFFs via the TIFFio and didn't complain on the 16-bit data, that it actually *used* the deeper color.

In another note to the list Bob Friesenhahn wrote:

"A potential solution to this problem is to gamma correct/translate
values associated with the color picker.  That way the color picker
always operates with gamma = 2.2."

This might work but the correct solution is to set this up so the picker
operates on the raw image data at whatever color depth that data has.  In
fact this is an absolute requirement as far as I am concerned as at this
point QImage is changing the data of 16 bit/channel images in the process of
loading the image and this in effect introduces what could be (likely are)
significant errors into the process.  This change to how LPROF works could be
fairly involved but it needs to be done and I will add this to my enhancement
list and give it a very high priority.

Can it be read-in via libtiff directly? Just a WAG on my part... I haven't looked at the code at all.

-Cory

--

*************************************************************************
* Cory Papenfuss                                                        *
* Electrical Engineering candidate Ph.D. graduate student               *
* Virginia Polytechnic Institute and State University                   *
*************************************************************************

Reply via email to