[Bf-committers] 16 bpc TIFF interpretation

David erwin94 at gmx.net
Mon May 7 12:01:54 CEST 2012


I submitted a patch yesterday, trying to fix this:


Now, looking at the code some more I found an inconsistency that I
don't understand. On the one hand the ImBuf documentation strongly
implies that rect_float is always supposed to be linear, and the profile
only indicates the colorspace of the rect buffer:

	float *rect_float;		/* floating point Rect equivalent
	                         * Linear RGB color space - may need gamma correction to
	                         * sRGB when generating 8bit representations */
	short profile;				/* color space/profile preset that the byte rect buffer represents */
 * \name Imbuf preset profile tags
 * \brief Some predefined color space profiles that 8 bit imbufs can represent

On the other hand, looking at various parts where profile is actually used
(e.g. divers.c), the profile is assumed to indicate the colorspace of whichever
buffer is filled with data at the moment (i.e. calling IMB_rect_from_float to
fill the rect assumes profile indicates the rect_float colorspace). This is of
course problematic, because afterwards both buffers have data and the colorspace
cannot be explicitly determined anymore (was the data filled in by rect_from_float
or float_from_rect?).

This leads me to believe that changing the code to follow the documentation and
always assume rect_float to be linear is the way to go, or alternatively introduce
another profile (profile_float?) to describe the colorspace of the float buffer.

till then, David.

On May 2, 2012, at 2:54 PM, Bartek Skorupa wrote:

> I'm not sure if this is known yet, but I recently noticed that 16bpc  
> tiff images are interpreted differently when viewed directly in UV  
> image editor and when passed to compositor.
> It seems as if sRGB gamma is used when source is viewed in UV image  
> editor, but in compositor no gamma correction is applied.
> Here is a comparison of the same image - upper panel - source viewed  
> in UV image editor, lower panel - taken from input image node to  
> viewer node:
> http://www.pasteall.org/pic/31145
> This comes from official Blender 2.63.
> Bartek Skorupa
> www.bartekskorupa.com
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list