BalanceGrade is a Nuke tool to neutralize and balance the color of multiple input plates. It presents an interface to assist with common operations like
- Applying a 3x3 ColorMatrix to calibrate the hue of an image.
- Matching a source color to a target color
- Calibrating the blackpoint of an image to be neutral
- Adjusting the exposure of an image in stops
- Balancing the color of an image with a multiply
These transforms are combined into a 3 operations: a 3x3 matrix, a multiply, and an offset. The grade can then be saved out to a single spimtx file, or an spimtx matrix + a cc file. Or you can export only a cc file if you are not using the 3x3 matrix to calibrate the colors of your image.
I've also included a version of the tool without the ColorMatrix if you prefer a simpler linear slope-offset color transform.
To calculate a calibration matrix you can use a tool like mmColorTarget or CalibrateMacbeth to generate a 3x3 matrix based on a Macbeth ColorChecker chart in an image. The matrix will calibrate the image based on the Macbeth chart to more closely match the white balance and color gamut of the target colorspace. Normally you would create your 3x3 matrix such that the exposure doesn't change too much.
When analyzing a sequence of shots for balancing the colors, there are a few important guidelines to follow.
- Don't push the colors too far from the original photography.
- Don't compensate for differences in lighting. Adjust overall exposure and color differences only.
- Identify a good target shot to pivot all the other shots towards.
- Arrange your shots by similar angle and field of view.
- Begin matching similar source colors to target colors.
- Work iteratively. Do a rough first pass on all the shots before refining.
- Evaluate in context. Don't focus exclusively on a single shot in isolation. Evaluate groups of similar shots and the entire sequence while you keep everything balanced together.
Blackpoint:
If you need to adjust the blackpoint of the image, there are a couple tools to help you. If you only want to neutralize the color of the blacks you can view the image you are adjusting and gain the viewer way way up to find the darkest blacks in the image. (Make sure you use gain and not gamma). Ctrl+shift+drag in the viewer to select the region you want to sample. Now click Set Blackpoint. The region is analyzed and the blackpoint knob is set with the values. If preserve luminance
is enabled, the overall brightness of the region won't change but the rgb will be equalized to remove color cast. Otherwise the sampled region will be set to 0, 0, 0
.
Source / Target matching:
Look at the image you are adjusting. Identify a good source color that matches a color you are trying to match to in your target. This could be a similar material between the two shots for example. Select the colorpicker on the src color
knob. Ctrl+Shift drag in the nuke viewer to set the value. Now view the target image, and do the same for the dst color
. You can do this in the reverse order as well if it is more intuitive. Don't forget to un-select the colorpicker or you might mess up your sample later!
Overall Grading: If you need to do aditional color matching by eye you can use the multiply knob. Make sure to use the floating color for more precision!
You can export to two formats.
- cc file Exporting a cc file will combine your adjustements into a SOP adjustment with only slope (gain) and offset (add). Note that any colormatrix you have applied will not be included.
- spimtx
the spimtx format is similar to the spi1d and spi3d lut formats, but contains a 3x3 matrix plus an offset value for each color channel (If you look at the exported file you might notice that the offset values are huge numbers. This is because they are expressed in 16 bit integer numbers, so 0 = 0 and 1 = 65535). If this format is used it will contain your matrix calibration and your combined slope and offset values. If you have
calibration only
checked, only the colormatrix calibration will be included.
These files can now be used in your OCIO color pipeline!
Happy balancing...
copy the raw code above and paste into Nuke.