Color Matching Analyzer

by Magnusson Productions in Scripts and Addons

"It's Just Not Real Enough!"

The biggest struggle I had in my early Blender days was merging my render on top of a background image.  For some reason, the render and the background didn't match, even when I used the same lighting setup.  I couldn't put my finger on why.  It just wasn't real enough.

While I studied Blender for visual effects and compositing (see here), I realized the game-changer in integration: color range.  See, every image has its own color range.  One image's black and white values won't be the same as another's.  And my render and background had different color ranges, hence the feeling that it still looked fake.



So I knew the problem, but I lacked the solution.  Clamping both the render and background image values led to more color data lost, and guess-timating the values lacked any sense of certainty.  So I created my own solution to speed up the compositing workflow, and the Color Matching Analyzer was born.

What Does this Addon Do?

The Color Matching Analyzer speeds image merging workflow by analyzing the minimum and maximum values of any image, which can be automatically applied to the compositor.

"Let's Just Take the Analyzer Data..."

In the image editor, you can get the maximum and minimum RGB values of an image with a single click.  This works for most images - one button, and you have the values!


Color Matching Analyzer picks your colors


For further precision, I added a custom-built color picker.  Now, you can directly pick the black and white areas, ignoring the saturated colors trying to throwing you off.  Once you've color picked to your pleasure, confirm it with a mouse click.

The picker compares its results to the black and white values you currently have, so if you don't find a darker black or whiter white, it'll stay as it is.  If you realize you color picked the wrong area, the reset button has got your back.

"...and Put It in the Compositor"

Okay, you say, but now what?  Brace yourself: more is coming.   Once you've found the white and black values of the image, press one more button.  Then, those values will be applied to an "alpha over" node group that takes the color range into account.

Now when you put your renders on a background image, the color ranges will match!  Better yet, my node setup is based on a scene-referred color space, so your color values are preserved!

"It was real!"

Whether you're adding a background image for your car model or creating visual effects, you need a guarantee that your art will look real.  The Color Matching Analyzer enables you to do just that: make your work feel more real to your audience.  And when it feels real, they can focus on the message you're trying to convey—not on the images you're trying to merge.


Updates

1.1.0 - A few changes to the compositor functionality for clarification.

1.0.1 - 2.80 compatible!  And I fixed a bug with empty images and render results for good measure.

The purpose of this add-on is to speed up image merging workflow by analyzing an image's color range. This can then be applied into the compositor. All the controls for this add-on can be found in the UV editor window on the right shelf (click "n" if the shelf isn't visible).

Calculate Picture

This simply takes the black and white RGB values for the selected image. It's a good start, but keep in mind that some areas of an image have different color ranges than other parts (multiple lights, colored lights, etc.) . That's where the color picker comes in.

Black/White Color Picker

You use this like a Blender color picker.  Hold down Ctrl while you move the mouse to color pick, left click or right click to apply and finish, or "Escape" to cancel.

This is useful for when you need a black or white value of a certain area. The picker compares its results to the black and white values you currently have, so if you don't find a darker black or whiter white, it'll stay as it is.

Reset

This is for your color picker, in case you accidentally pick an area that will throw off your black or white values. This resets your min color to absolute white, and your max color to absolute black.

Add to Compositor

Adds a color balance node to your compositor, applying the black and white values you just calculated or picked!

I can't use the Color Matching Analyzer on my render result. Why?

Blender doesn't save the current render pixel data, so the add-on can't access those pixels through the API.

To merge a render onto the background, you'll want to analyze the background image anyway—not the render.  But if you must analyze the render, one workaround is this: go to the compositor, connect the RenderLayer to a viewer node, and view the viewer node in the image editor.  The analyzer will be able to read those pixels.

I used the overall picture analysis and applied to the compositor, but it doesn't look right. Why?

Check if you have any very saturated colors in your picture.  The saturation can throw off the black and white values you are looking for.  Reset the colors and use the color picker instead to get a more specific analysis.

Why did the reset button set the min value to white and the max value to black?

The color picker picks the minimum and maximum values of the image, with the current max and min colors as a reference.  This allows you to pick an image multiple times and get the correct values.  The reset button sets the black value to white and the white value to black so the color picker can function as intended.  To change the values, use the color picker or analyze the whole image.

Purchase this item to leave a review!