diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-30 18:17:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-30 18:17:11 +0400 |
commit | d7d856a23de2b6751a46632130f941a71377d134 (patch) | |
tree | 67662eadc78a4145eba4f0a9e04655cb1adb9edb /source/blender/nodes | |
parent | 424e09a2cec805aa67824385c16a1d267fb1022b (diff) |
Color management: add "Color Unpremultiply" option for images and render settings.
For premultiplied alpha images, this makes any color space conversion for the image
or render output work on color without alpha multiplied in.
This is typically useful to avoid fringing when the image was or will be composited
over a light background. If the image will be composited over a black background on
the other hand, leaving this option off will give correct results.
In an ideal world, there should never be any color space conversion on images with
alpha, since it's undefined what to do then, but in practice it's useful to have
this option.
Patch by Troy Sobotka, with changes by me.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/composite/node_composite_util.c | 2 | ||||
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_image.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index 8aaf1771b68..72037f232ad 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -607,7 +607,7 @@ void generate_preview(void *data, bNode *node, CompBuf *stackbuf) bNodePreview *preview= node->preview; int xsize, ysize; int profile_from= (rd->color_mgt_flag & R_COLOR_MANAGEMENT)? IB_PROFILE_LINEAR_RGB: IB_PROFILE_SRGB; - int predivide= 0; + int predivide= (rd->color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE); int dither= 0; unsigned char *rect; diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index fd7c87adea2..57b5cec4256 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -62,7 +62,7 @@ static bNodeSocketTemplate cmp_node_rlayers_out[]= { float *node_composit_get_float_buffer(RenderData *rd, ImBuf *ibuf, int *alloc) { float *rect; - int predivide= 0; + int predivide= (ibuf->flags & IB_cm_predivide); *alloc= FALSE; |