5
$\begingroup$

I tried for so long to look info for this problem and found basically nothing. I am trying to adopt a technique from Photoshop to Blender to match the colors of 2 different scenes, but end up in the problem, that in Blender we don't have "luminosity".

In photoshop the technique in a nutshell: You have 2 scenes with a mask mixed together. Then you add over them a 50% gray layer with luminosity. That way you will get a color map of all the colors you have in the scene.

If you now add saturation to that output, you can clearly see the color differences from the different scenes and it is very easy to fix the colors from the other scene to match it with the other one. Then you can delete the neutral and saturation layers.

So I tried to do this in Blender and found out that we don't have "luminosity", so I am trying to look something that works a similar way.

Here is the technique in Photoshop explained very clearly:

https://youtu.be/2SBgHDwt16s?t=57s

$\endgroup$
2
$\begingroup$

TL;DR is that there is no canonical method to derive "value", and it is up to the various applications to determine how it derives it within the constraints, using arbitrary formulas.

While luminance has a very strict definition and varies from RGB colour space to RGB colour space, rarely does bad software handle it properly. The Y in YCbCr also varies based on the coefficients used.

In photoshop the technique in a nutshell: You have 2 scenes with a mask mixed together. Then you add over them a 50% gray layer with luminosity. That way you will get a color map of all the colors you have in the scene.

Photoshop's handling isn't a reference. This is because it is a display referred application and handles colour in a hacky kludgy manner based on the limitations of the display referred model. The formulas Photoshop uses are mostly strictly display referred and can not work in a scene referred environment such as Blender. To see the display referred formulas, you can research the Adobe PDF specification that outlines the various blend modes. Specifically, in a scene referred model, colour energy values extend from potentially zero to potentially infinity, subject to quantisation limits.

The notion of 50% grey varies from implementation to implementation based on the models used.

So I tried to do this in Blender and found out that we don't have "luminosity", so I am trying to look something that works a similar way.

To apply a colour to greyscale image, you'd have to reverse the average luminance to the colour you have chosen. This is a non-trivial problem in a scene referred application such as Blender because of the variables involved. For the record, the proper luminance weights for a REC.709 / sRGB based reference space are:

(0.2126 * R) + (0.7152 * G) + (0.0722 * B) = Average Luminance

This works for both display referred and scene referred values, and as of the most recent master branch of Blender, should be what the RGB to BW node delivers.

$\endgroup$
1
$\begingroup$

It is, so V from HSV can be used.
Split the image, do your adjustment on the V channel, recombine.

https://blender-manual-i18n.readthedocs.io/ja/latest/composite_nodes/types/converter/combine_separate.html

Y is also Luminance, using YUV or YCbCr colorspaces.
Those are based on PAL or NTSC, so you can try those, if you prefer.

$\endgroup$
2
  • $\begingroup$ That does not give me the colors. I have now only a black and white image as a result, but to match the colors I need the colors only without value contrast. That's why he is using the 50% gray to get only the colors from the image. If I mix one of those you told about with "color" to the original image, I don't get similar results as in the video. $\endgroup$
    – Artturi
    Jan 12 '18 at 20:06
  • $\begingroup$ Hue is color. HSV = Hue, Saturation, Value. $\endgroup$ Jan 13 '18 at 2:17
1
$\begingroup$

I realized that Color blend mode is an opposite version of Luminosity. So if you change the order of the color data, you will get the same result as you would get with luminosity. That is maybe also the reason why Blender don't have luminosity blend mode because you get the same result with Color if wanted.

$\endgroup$
1
  • 2
    $\begingroup$ I don't get why this was downvoted. This is the correct answer to the problem. $\endgroup$
    – Artturi
    Feb 2 '18 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.