Index: source/blender/imbuf/intern/tiff.c =================================================================== --- source/blender/imbuf/intern/tiff.c (revision 46354) +++ source/blender/imbuf/intern/tiff.c (working copy) @@ -315,11 +315,13 @@ static void scanline_contig_16bit(float *rectf, unsigned short *sbuf, int scanline_w, int spp) { int i; + float tmp[4]; for (i=0; i < scanline_w; i++) { - rectf[i*4 + 0] = sbuf[i*spp + 0] / 65535.0; - rectf[i*4 + 1] = (spp>=3)? sbuf[i*spp + 1] / 65535.0: sbuf[i*spp + 0] / 65535.0; - rectf[i*4 + 2] = (spp>=3)? sbuf[i*spp + 2] / 65535.0: sbuf[i*spp + 0] / 65535.0; - rectf[i*4 + 3] = (spp==4)?(sbuf[i*spp + 3] / 65535.0):1.0; + tmp[0] = sbuf[i*spp + 0] / 65535.0; + tmp[1] = (spp>=3)? sbuf[i*spp + 1] / 65535.0: sbuf[i*spp + 0] / 65535.0; + tmp[2] = (spp>=3)? sbuf[i*spp + 2] / 65535.0: sbuf[i*spp + 0] / 65535.0; + tmp[3] = (spp==4)?(sbuf[i*spp + 3] / 65535.0):1.0; + srgb_to_linearrgb_v4(rectf + i*4, tmp); } } @@ -337,8 +339,14 @@ static void scanline_separate_16bit(float *rectf, unsigned short *sbuf, int scanline_w, int chan) { int i; - for (i=0; i < scanline_w; i++) - rectf[i*4 + chan] = sbuf[i] / 65535.0; + if (chan != 3) { + for (i=0; i < scanline_w; i++) + rectf[i*4 + chan] = srgb_to_linearrgb(sbuf[i] / 65535.0); + } + else { + for (i=0; i < scanline_w; i++) + rectf[i*4 + chan] = sbuf[i] / 65535.0; + } } static void scanline_separate_32bit(float *rectf, float *fbuf, int scanline_w, int chan) @@ -464,7 +472,7 @@ _TIFFfree(sbuf); if (success) { - ibuf->profile = (bitspersample==32)?IB_PROFILE_LINEAR_RGB:IB_PROFILE_SRGB; + ibuf->profile = (bitspersample>=16)?IB_PROFILE_LINEAR_RGB:IB_PROFILE_SRGB; // Code seems to be not needed for 16 bits tif, on PPC G5 OSX (ton) if (bitspersample < 16)