Digital Bolex D16: Bolex Log

Following the release of firmware 1.5 “Elf” there hasn’t been any support in any major software for using Bolex Log with DNGs from your D16. This is going to be a fairly quick article showing how to use Bolex Log with Davinci Resolve. This article assumes you already have a basic knowledge of Resolve and can get to the point of having your timeline setup and ready for grading/dailies etc. I’ll include the math I used at the end of the article for those interested.

First off you’re going to download this LUT here. You’ll get a 442 MB .cube file. This LUT is much larger than your average 3D LUT (2563 vs 653). This is because we have a large range of values for BT.709 input (-0.05, 4.48), and we want to do precise color space transforms. So I used the maximum possible size according to the cube LUT spec. This reduces the amount of interpolation error and Resolve has no performance hit using this larger LUT.

Once downloaded you’re gonna want to copy the file to Resolve’s LUT folder. You can access it by going into Project Settings -> Color Management -> Open LUT Folder. Create a Digital Bolex folder and copy the cube LUT into it. When you’re done, hit “Update Lists” so you can use the LUT without having to restart Resolve.

openlutfolder

After that you want to make sure you have your Camera Raw settings done properly. First, make sure you’re using Rec. 709 for both color space and gamma. Some of you are probably wondering “why use Rec. 709? I thought Rec. 709 loses image data/detail. Why not BMD Film?”

Well, 709 is the default color space option. The less fiddling with controls you have to do, the better. And you would be correct about 709 losing information if it were encoded to a file already. But because the DNG is transformed to 709 in Resolve’s unclipped floating point engine, we can recover a perfect linear image because we know 709’s inverse function and its primaries. Which brings us to BMD Film. BMD didn’t publish any white paper on BMD Film at all. So we have no idea how to reverse the curve or the gamut.

Now that we’re past that, we need to make sure that highlight recovery is enabled so we can get extra goodness from our unclipped channel highlights. Make sure not to use the Pre Tone Curve or Soft Clip options. They don’t help us here at all and they change the underlying linear image.

With these settings you’re free to change your white balance and everything on the clip level as well in the timeline.

camraw
Forgive the poorly drawn shapes

Now that our CinemaDNG settings are done we can actually get to using the LUT. So, in a project where you have nothing but D16 footage, you can just set the BT.709 to Bolex Log LUT as the 3D Input LUT under color management.

lut

Once that’s done, you should see all of the detail that your D16 capture come back in range. Now you’re ready to grade. If you end up rendering out the Bolex Log footage but would like a way to reverse the transform for whatever reason, you can use the function and matrix available in the Bolex Log & Wide Gamut RGB Technical Summary.

Have fun getting the most from your D16!

example
DNG courtesy of Richie Allen. Split of Bolex Log and D16/film look LUT

MATH!!!

Okay, I’m not gonna into all of the math for the LUT. Just the general flow of it.

First is reversing the BT.709 curve using the following:

if (input[i] < 0.081)
lin[i] = input[i] / 4.5;
else
lin[i] = pow((input[i] + 0.099) / 1.099, 1.0 / 0.45);

Once linearized we can convert the gamuts. I pre-calculated the matrix to convert the 709 gamut to Bolex Wide Gamut. Instead of using conventional 3×3 3×1 matrix multiplication to convert the RGB values, I used the method described by Jon McElvain and Walter Gish of Dolby Labs. This minimizes color errors as we get closer to the boundaries of the gamuts.

// Convert gamut
double mat[9] =
{ 0.6537569872724, 0.2676207478388, 0.0787012220866,
0.0682990061249, 0.8001173304931, 0.1315446060485,
0.0125090201694, 0.0773426564045, 0.8250305747061 };

double sigma = lin[0] + lin[1] + lin[2];
double p = lin[0] / sigma;
double q = lin[1] / sigma;

value[0] = ((mat[0] - mat[2]) * p + (mat[1] - mat[2]) * q + mat[2]) * sigma; // red
value[1] = ((mat[3] - mat[5]) * p + (mat[4] - mat[5]) * q + mat[5]) * sigma; // green
value[2] = ((mat[6] - mat[8]) * p + (mat[7] - mat[8]) * q + mat[8]) * sigma; // blue

Now that gamut conversion is done, we can take our wide gamut, scene-referred linear values and encode them to Bolex Log.

if (value[i] >= 0.0149480)
out[i] = 0.2756705 * log10(5.5555556 * value[i] + 0.0280665) + 0.4150634;
else
out[i] = 5.9861078 * value[i] + 0.0625265;

And that’s the basic transform pipeline. Thanks for reading!

Spaces Raw: CineForm Raw for Davinci Resolve

For the past couple of months I’ve been wanting to challenge my programming abilities since I’m close to transferring to uni. To do that I decided to try my hand at getting Davinci Resolve to read CineForm Raw (CFR from now on) files as if they were DNGs. I believe I’ve done a fairly sufficient job with this plugin. Here are the “specs” of the plugin.

  • OFX Win64 only (OS X in development)
  • 32 fps 2K 16:9 on i7-3770K Turbo O.C. 4.4 GHz
  • Uses combination of continuous functions and 16b tables of 32b floats to maintain speed and accuracy

Install by copying the bundle folder from the zip here:
C:\Program Files\Common Files\OFX\Plugins\
If you don’t have this folder, you can create it yourself.

I made sure to try to make the plugin as inclusive as possible when it came to options. So here is the complete list as of April 8, 2015.

Input Curve:
  • Protune
  • Optimize for 9 Stops
  • Optimize for 10 Stops
  • Optimize for 11 Stops

Okay, these are the curves that you would choose in the “Advanced Settings” window of GoPro Studio when converting your DNG files. You need to match these up so the plugin can correctly invert the log encoded CF file for color processing. I excluded 12 stop, 13 stop, and video because Resolve didn’t even read them as an image of those curves. So I just opted not to bother with them.

Color Gamut:
  • ACES
  • Bolex Wide Gamut RGB (not official, my proposed spec)
  • DCI P3
  • Rec. 2020
  • Rec. 709/sRGB
  • Sensor RGB/BMD Film

All of your favorite color gamuts! You can now control a CFR file’s output color gamut. I tried to get the most common ones in there.

Output Curve:
  • BMD Film
  • BMD Film 4K
  • Bolex Log (again, my proposed spec)
  • BT.1886
  • Cineon
  • Gamma
  • Scene Referred Linear
  • Sensor RGB
  • sRGB

Again, I tried to get the most common transfer functions. All of these are written according to their official documentation except for BMD Film (4K) which was added from the 12b LUTs included with Resolve. The gamma slider affects only the gamma option. The Sensor RGB transfer function gives the linear data as if you were looking at the uncorrected, linear DNG image. In other words, it doesn’t bring the linear image to scene referred values where middle gray is 0.18, it gives the data as it was recorded.

White Balance:

  • Custom
  • Tungsten (Incandescent) (2850K)
  • White Fluorescent (3450K)
  • Lite White Fluorescent (4150K)
  • Horizon Daylight (5000K)
  • Daylight (5500K)
  • Noon Daylight (6500K)
  • North Sky Daylight (7500K)

Okay, this part’s a little quirky and is likely to confuse some people. You get the normal options for white balance presets and two sliders for temperature and tint. The thing is the numbers on those sliders only update when in Custom mode. So, say you’re using Tungsten. The sliders will still show 6500 and 0 if you haven’t changed them. The sliders also don’t affect the image unless you’re in Custom mode. I know it’s weird, I just haven’t worked out the logic that works with the OFX API yet; I’ll get it fixed eventually.

Exposure Index:

  • 100
  • 200
  • 400
  • 800
  • 1600

I’m not exactly sure what options the Blackmagic cameras have, but these are the ones I thought to be most common. Use these to make the image exposure match what you were shooting at. So if you shot at 1600 ASA on the camera, put that here too, otherwise your exposure will be off. D16 users should set this to 200 if they shot at exposure without underexposing or ETTR.

Highlight Recovery: I attempted to write a highlight recovery algorithm. I think it does a decent job. Of course, it’s not perfect, but it does the job in real time.

Capture

Here we have the plugin in action on a CFR file. The plugin acts as the raw panel and then on nodes after you can do your grading. Here the second has the BMD Film to Rec 709 v2 LUT that comes with Resolve with a wipe to show the difference between the plugin’s BMD Film and the LUT.

And an example by Jon DeNicholas, shot on the D16.

You can download the plugin for free on my downloads page or if you’re feeling generous, you can buy the plugin through PayPal for whatever price you deem it to be worthy. Thank you for visiting my page and taking interest in my work, and I hope you find it useful.

Cheers!

Using Rec. 2020 as a Starting Point in DaVinci Resolve 11

Most CinemaDNG compatible programs don’t give many options in the way of suitable starting points right out of the box, so we’re forced to tweak what the program gives us until we have a neutral place to start our grade from. More often than not, the problem is that the colors are too vibrant and are oversaturated. This has to do with the fact that these programs, more than likely, adhere to the sRGB color space. Such is the case with Resolve, the only options being Rec. 709, P3D60, and BMD Film. The problem with this is that when dealing with footage from a cinema camera that doesn’t have a documented, wide gamut color space, we don’t get to see the “cinema” colors from the footage. This is because cinema cameras recording raw data capture a much wider range of colors than sRGB can properly display.

Now in order to make this process of getting to a better starting point a little less painless I’ve created a LUT that puts your footage into the ITU Rec. 2020 color space when coming from Rec. 709 or sRGB (709 and sRGB share the same color gamut). Rec. 2020 is a much wider color space than sRGB, so the footage will appear less saturated compared to when viewing in sRGB. This should provide a more “neutral” starting point for you to grade your footage from.

rec709_rec2020
Illustration of the Rec. 2020 and Rec. 709 color gamuts. As you can see, Rec. 2020 fully encompasses Rec. 709 and more.

Note: All of the color spaces mentioned are display standards. sRGB is defined by the IEC, and is used by most computer displays. Rec. 709 is defined by the ITU, and is used by most HD televisions.

Using the LUT

First you’re going to have to download the LUT; it should be a “.cube” file.

Some people on Mac have reported that the file gets downloaded as a “.cube.txt” file. While I haven’t experienced this on my Mac, others reported this fix:

  1. Right click the file and go to Get Info
  2. Change the extension back to “.cube” and untick the hide extension box

Next go ahead and install the LUT. The easiest way to do this is start up Resolve, open the default project, then go to the Project Settings by hitting the cog in the bottom left corner. From there go to the Lookup Tables tab and hit Open LUT Folder. Then just copy the LUT into the folder. Then back in Resolve, hit Update Lists. Now you can use it in any project. To use it on all imported footage, without having to add a node for it on every clip, set it as the 3D Input Lookup Table.

Now you just need to adjust your settings in the raw panel. Make sure the color space is set to Rec. 709 and your gamma is set to Linear. I can not stress how important this is. If these aren’t set correctly, you will not get results that are compliant with the LUT’s intent. The LUT mathematically converts these values to Rec. 2020 so it’s possible to reverse it later if need be. While in the raw panel, you should do any raw adjustments you need to, e.g. exposure or highlight/shadow recovery. Now you can grade to your heart’s content!

Camera Raw panel in Resolve 10. Feel free to change White Balance and any other raw settings; these affect the image before any color space correction and are better than fixing it after the fact.
Image displayed in Rec. 709 color space with a -0.5 exposure adjustment. No other adjustments made. Image courtesy of Thomas Blake Ramsey.
Same image displayed in the Rec. 2020 color space with the same -0.5 exposure adjustment.

I hope y’all found this helpful. You can put any questions in the comments section below, and you can also find me on the Digital Bolex forums under the handle iaremrsir. Thanks for reading my first ever blog post!