Add new comment

Pixel values modified after Tiff creation

Hi all,

my colleague and I found a weird problem that we can't explain. Our goal is simply to create a tiff from a PhaseOne IIQ format without any processing done except the interpolation for the demosaicing.
While trying to use the tiff creation functionality of libraw we couldn't get the pixel value we wanted and came to the conclusion that something is modifying the pixel values during the tiff creation process.
When I try to do a simple test, I set all the pixel values to 1000 directly in the code but while opening the tiff I was not able to get the value 1000, instead it was 4500 for some reason. Saving the image using openCV produced the correct value. The range of the pixel value is to 65536 for 16 bit unsigned type.

Maybe I m missing something here while activating some option. Any help is welcome.

Thanks in advance


/** Output options *//
RawProcessor.imgdata.params.output_tiff = 1; // TIFF output
RawProcessor.imgdata.params.output_bps = 16; // 16-bit output
RawProcessor.imgdata.params.no_auto_bright = 1; // We do not want auto brightness
/** Part changing the pixel values */
for (int rc = 0; rc < cols * rows; ++rc)
  RawProcessor.imgdata.image[rc][0] = 1000;
  RawProcessor.imgdata.image[rc][1] = 1000;
  RawProcessor.imgdata.image[rc][2] = 1000;
/** This part will create the tiff **/
int res = RawProcessor.dcraw_ppm_tiff_writer(sTiffName.c_str());