Inside BMPCC DNG & A Better Demosaic

The place for questions about shooting with Blackmagic Cameras.
  • Author
  • Message
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Inside BMPCC DNG & A Better Demosaic

PostSat Nov 25, 2023 4:00 am

First, the results.

The following frame is a 1920x1080 capture from a BMPCC OG at 800iso.

Image

The first crop below is the result of opening the dng in resolve, with many color artifacts which will flicker in motion, and the second is the demosiac method I am going to describe in a later post. This is from a single dng frame so no temporal noise reduction etc was used.

Image

Image

This camera is only 1080p and very prone to artifacts, so finding smart ways to limit them will be essential to make it usable in a production, which is the real goal here - to tell great stories with this tiny camera and not let its technical issues distance the audience.

For some background, I recently bought a Micro Cinema Camera because I was interesting in tinkering with DNGs, mostly to teach myself about color science and image processing. I installed a Rawlite OLPF into my camera pretty shortly after I received it and so I have a few stills with and without the rawlite.

Some interesting things I learned upon opening the pocket and micro's DNGs are the following:

- The BMPCC's actual recorded resolution is 1952x1112, but the DNG instructs the file to be opened in 1920x1080. This leaves 16 pixels to the left, right, above and below the image. A lot of demosiacs need minimum 3 pixels each direction to work, so an artifact free 1946x1106 image is possible.

- The BMMCC's actual recorded resolution is 1952x1104, but the DNG instructs the file to be opened in 1920x1080. This leaves 16 pixels to the left and right, and 12 above and below the image. An artifact free 1944x1098 image is possible

- The blackmagic pocket reads its sensor 33% slower than the micro (more rolling shutter). Besides what I already mentioned about the recorded resolutions, the sensors are seemingly identical.

- The rawlite OLPF does not seem to change exposure or white balance but does greatly reduce moire and color contamination in the red channel. It does not have a noticeable effect on sharpness given that any such sharp edges would cause artifacts without the olpf, and as a compromise of its weak effect on sharpness moire is still present in some situations.

- The native white balance of both cameras could be said to be ~4500K. This is where the red and blue channels have about equal gain, i.e the most similar sensor noise and clipping points on a neutral colored object. This seems to already take into account the cyan colored IR filter/rawlite olpf in front of the sensor.

- The green channel is about 2/3rds of a stop brighter, and so clips 2/3rds of a stop sooner, and because there are twice as many green photosites the green channel noise is less pronounced.

- The most fundamental part of the camera's color science, the color matrix, has very high coefficients on the blue channel reconstruction. This basically means the blue channel will always be noisier than red and green even when the sensor has good, even exposure. Lighting above 4500k might make for a less noisy image even if it's not the native.

- The sensor of the BMMCC is slightly less noisy once it's 'warmed up'. In cool weather, recording immediately after turning the camera on increases noise (imperceptibly, but it shows up on the scopes). I also tested if powering via 12v AC adapter or 7v battery made a difference but I didn't see any.

- Inside the DNG the cameras both default to an exposure very close to 200iso, but have excellent linearity down to their noise floors. Color and saturation are reproduced really well even rating them at 6400iso.

- The DNG lists standard/default black points and white points but resolve seems to load more accurate ones. We will find out what these accurate ones are with our new demosaic method.

- The most accurate color science in resolve by far is to open the .dng as Color Space / Gamma [Blackmagic Design G1 / Blackmagic Design Film] and then use a color space transform from that to the desired output. We are going to target this same color science which will make comparison easy.

- Resolve's highlight reconstruction is really well tuned. In fact the main improvement by not using resolve's demosiac, and instead do a lot of extra steps, is mostly to avoid pixel sized color and edge artifacts. Otherwise resolve behaves excellently.

- Bayer cameras have one red, one blue, and two green color paths. These cameras are both prone to a "screen door" effect, caused by the two green channel's signal paths having slightly different sensitivities. You're going to see this most often when shooting at low ISO and we will be able to fix it with the new demosaic method.

Image
Offline

iaburn

  • Posts: 8
  • Joined: Wed Nov 15, 2023 10:42 am
  • Real Name: Eduardo Añibarro

Re: Inside BMPCC DNG & A Better Demosaic

PostThu Nov 30, 2023 10:17 pm

Were you presenting something? I think I missed the point of your post :roll:

You can minimize this color artifacts in Photoshop with the "Raw details" effect. An example:
screendoor.png
screendoor.png (623.77 KiB) Viewed 6272 times
Offline
User avatar

Jamie LeJeune

  • Posts: 2008
  • Joined: Tue Feb 26, 2013 4:33 am
  • Location: San Francisco

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 01, 2023 8:06 pm

Anton_Shavlik wrote:- The most accurate color science in resolve by far is to open the .dng as Color Space / Gamma [Blackmagic Design G1 / Blackmagic Design Film] and then use a color space transform from that to the desired output. We are going to target this same color science which will make comparison easy.
There's a caveat to consider — with BMD Gen 1 the transforms are color temp dependent (same is true for Gen 3, but not for Gen 4 or 5), but the Color Space Transform OFX does the math from Gen 1 (and Gen 3) as if the source clip is 6500 Kelvin.

More here:
https://forum.blackmagicdesign.com/viewtopic.php?t=159144&p=844164#p844396
www.cinedocs.com
http://www.imdb.com/name/nm4601572/
Offline

Howard Roll

  • Posts: 2448
  • Joined: Fri Jun 03, 2016 7:50 am

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 01, 2023 9:19 pm

I'm guessing the source WB is pretty close to 6000 since that what it was when I shot this footage, 7 years ago, out my kitchen window.

Forgive my tired brain, did I make these DNGs available online?

I only ask because 2 years ago I had several boxes of gear (including several drives) stolen by my movers. This wouldn't be the first time I've come across the scattered remnants of that heinous act.

Seriously though, the stacked stone really elevated the space.

Good Luck

ss.jpg
ss.jpg (179.71 KiB) Viewed 6233 times
Offline
User avatar

roger.magnusson

  • Posts: 3329
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 01, 2023 11:59 pm

Googling BMPCC/BMMCC DNGs, that image is in a dropbox folder together with a bunch of other samples.
https://forum.blackmagicdesign.com/viewtopic.php?f=2&t=82609#p461531
Offline

Howard Roll

  • Posts: 2448
  • Joined: Fri Jun 03, 2016 7:50 am

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 8:33 am

Thanks for that.

Good Luck
Offline

Bunk Timmer

  • Posts: 169
  • Joined: Sat Oct 15, 2016 8:14 pm

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 8:42 am

I still use the bmpcc and bmcc, so if you did find a better way to demosaic, I’m interested in hearing how.
Offline

Michel Rabe

  • Posts: 647
  • Joined: Thu Aug 29, 2013 8:06 pm

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 9:41 am

roger.magnusson wrote:Googling BMPCC/BMMCC DNGs, that image is in a dropbox folder together with a bunch of other samples.
https://forum.blackmagicdesign.com/viewtopic.php?f=2&t=82609#p461531


Some great images. I regret having sold the BMPCC.
Offline

ShaheedMalik

  • Posts: 676
  • Joined: Wed Aug 19, 2020 5:28 am
  • Real Name: Shaheed Malik

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 4:46 pm

Jamie LeJeune wrote:
Anton_Shavlik wrote:- The most accurate color science in resolve by far is to open the .dng as Color Space / Gamma [Blackmagic Design G1 / Blackmagic Design Film] and then use a color space transform from that to the desired output. We are going to target this same color science which will make comparison easy.
There's a caveat to consider — with BMD Gen 1 the transforms are color temp dependent (same is true for Gen 3, but not for Gen 4 or 5), but the Color Space Transform OFX does the math from Gen 1 (and Gen 3) as if the source clip is 6500 Kelvin.

More here:
https://forum.blackmagicdesign.com/viewtopic.php?t=159144&p=844164#p844396


I reread a bunch of those threads and I want to know if you could answer this:
What is the best way to get a camera such as a BMPCC, BMCC, or Production 4K into Gen 5? Thanks.
Offline
User avatar

rick.lang

  • Posts: 17103
  • Joined: Wed Aug 22, 2012 5:41 pm
  • Location: Victoria BC Canada

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 5:31 pm

See post #3 in this thread.
Rick Lang
Offline

ShaheedMalik

  • Posts: 676
  • Joined: Wed Aug 19, 2020 5:28 am
  • Real Name: Shaheed Malik

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 7:13 pm

rick.lang wrote:See post #3 in this thread.

That's literally the post I am responding to.
Offline
User avatar

rick.lang

  • Posts: 17103
  • Joined: Wed Aug 22, 2012 5:41 pm
  • Location: Victoria BC Canada

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 10:43 pm

But doesn’t post #3 tell you how to get Gen 5 from older cameras? Use a CST node in Resolve / Colour page? Apologies if I’m a bit thick today as yesterday was about 12 hours of editing etc.
Rick Lang
Offline

VMFXBV

  • Posts: 535
  • Joined: Wed Aug 24, 2022 8:41 pm
  • Real Name: Andrew I. Veli

Re: Inside BMPCC DNG & A Better Demosaic

PostSat Dec 02, 2023 11:17 pm

Shoot CinemaDNG and debayer gen 4 then cst to gen 5. If Capt. Hook is correct then ProRes doesnt work properly since its color dependent 6500K but RAW works.

Also OP you kinda ended your post with a cliffhanger.
AMD Ryzen 5800X3D
AMD Radeon 7900XTX
Ursa Mini 4.6K
Pocket 4K
Offline

ShaheedMalik

  • Posts: 676
  • Joined: Wed Aug 19, 2020 5:28 am
  • Real Name: Shaheed Malik

Re: Inside BMPCC DNG & A Better Demosaic

PostSun Dec 03, 2023 1:18 am

VMFXBV wrote:Shoot CinemaDNG and debayer gen 4 then cst to gen 5. If Capt. Hook is correct then ProRes doesnt work properly since its color dependent 6500K but RAW works.

Also OP you kinda ended your post with a cliffhanger.


What's the correct input to do this? The raw tab lists it as Blackmagic Design 4K Film Gen 4 but the CST doesn't list Blackmagic Design 4K Film Gen 4, only Gen 3.
Offline

Howard Roll

  • Posts: 2448
  • Joined: Fri Jun 03, 2016 7:50 am

Re: Inside BMPCC DNG & A Better Demosaic

PostSun Dec 03, 2023 9:24 am

ShaheedMalik wrote:
VMFXBV wrote:Shoot CinemaDNG and debayer gen 4 then cst to gen 5. If Capt. Hook is correct then ProRes doesnt work properly since its color dependent 6500K but RAW works.

Also OP you kinda ended your post with a cliffhanger.


What's the correct input to do this? The raw tab lists it as Blackmagic Design 4K Film Gen 4 but the CST doesn't list Blackmagic Design 4K Film Gen 4, only Gen 3.


Is there a difference in the end result if you go from 1 to 5, or 4 to 5? Seems to me that if the math is consistent you should get the same result if decoding to Gen 1 or 4.

Good Luck
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostMon Dec 04, 2023 9:07 am

VMFXBV wrote:Also OP you kinda ended your post with a cliffhanger.


Sorry, I guess this forum needs new threads to be approved, or my account was too new, so the post didn't seem like it had gone through and I only checked again now. I'll write up the second half tomorrow.
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostMon Dec 04, 2023 9:34 am

DNG specification is to have one matrix for 2855K (called Standard Illuminant A) and another for D65, both which convert to XYZ D50 (actually they are written as inverse matrices for reasons I do not know). And the BMPCC/BMMCC follow this specification and the matrices seem to be good.

The idea is to interpolate between these two standards along with different channel gains to get white balance and color reconstruction for, say, 5300k. That's done by whatever software is doing the demosaic.

I have been reading through the blog "strolls with my dog" while digging into this stuff and I think they have a thorough explanation, starting with their post "Linear Color Transforms"
Offline

VMFXBV

  • Posts: 535
  • Joined: Wed Aug 24, 2022 8:41 pm
  • Real Name: Andrew I. Veli

Re: Inside BMPCC DNG & A Better Demosaic

PostMon Dec 04, 2023 11:20 am

ShaheedMalik wrote:
What's the correct input to do this? The raw tab lists it as Blackmagic Design 4K Film Gen 4 but the CST doesn't list Blackmagic Design 4K Film Gen 4, only Gen 3.


For gamma you choose the corresponding gamma. E.g: Ursa 4.6K > Blackmagic Design Film 4.6K
For color space: Blackmagic Design Wide Gamut 4/5.

Howard Roll wrote:
Is there a difference in the end result if you go from 1 to 5, or 4 to 5? Seems to me that if the math is consistent you should get the same result if decoding to Gen 1 or 4.

Good Luck


If the math works properly then there should be no difference. I think I even tested this at some point and there was no difference but I'm working from memory right now.
AMD Ryzen 5800X3D
AMD Radeon 7900XTX
Ursa Mini 4.6K
Pocket 4K
Offline

ShaheedMalik

  • Posts: 676
  • Joined: Wed Aug 19, 2020 5:28 am
  • Real Name: Shaheed Malik

Re: Inside BMPCC DNG & A Better Demosaic

PostMon Dec 04, 2023 2:15 pm

VMFXBV wrote:
ShaheedMalik wrote:
What's the correct input to do this? The raw tab lists it as Blackmagic Design 4K Film Gen 4 but the CST doesn't list Blackmagic Design 4K Film Gen 4, only Gen 3.


For gamma you choose the corresponding gamma. E.g: Ursa 4.6K > Blackmagic Design Film 4.6K
For color space: Blackmagic Design Wide Gamut 4/5.

Howard Roll wrote:
Is there a difference in the end result if you go from 1 to 5, or 4 to 5? Seems to me that if the math is consistent you should get the same result if decoding to Gen 1 or 4.

Good Luck


If the math works properly then there should be no difference. I think I even tested this at some point and there was no difference but I'm working from memory right now.

I think this works well enough. I have to more tests to see if I can get similar results out of my cameras. This time I will use my color chart.

Thanks
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostMon Dec 04, 2023 9:04 pm

Sorry if this ends up being a triple or quadruple post, my posts do not show up until much later than I posted them.

The behavior of the CST with regard to color temp was something I hadn't tested and it turned out to be a great aspect to look into. Resolve has four ways to get their camera's DNG to Rec709.

As a reference I shot this DSC Labs chart in a black container with direct sunlight on a cloudless day. My Sekonic 700-C measured the color temp as exactly 5400K while resolve's raw controls white balance the grey chip at 5250K and 14 tint, which could be due to the lens.

The scopes were set to 75% targets and 2x magnify.

This is if you set Rec709 as the colorspace and gamma on the raw tab. It seems to be using the matrices embedded inside the DNG. You can see the Blue channel is really off its hue angle.
Image

This is if you use the "Blackmagic Design Cinema Camera to Rec709 V2" LUT. You can see the skin tones in the highlights are getting suppressed and skewed toward yellow.
Image

This is if you set the raw to blackmagic log and Gen 1 color, and use the correct CST. The colors are pretty accurate.
Image

And this is using Gen 4 color science in the raw and "video gamut gen 4" in the CST. The reds render darker, blues and greens lighter and there is a slight shift in hues and saturation.
Image

Ok so it seems like Gen 1 and Gen 4 handle 5400k about equally well. I also have a 98CRI 4000k bulb from "norb". It's really in another league as far as using as a consumer LED for use as a reference light. Let's see how the

4000K Gen 1 - Saturation and hue is pretty off with the CST.
Image

4000K Gen 4 - Saturation and hue match the 5300K CST much better!
Image

So yeah use Gen 4 and the CST, it's by far the best.
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostTue Dec 05, 2023 3:31 pm

I am also looking forward to your new demosaic method. Especially if it also can fix cross-hatching pattern. It's been a lot of discussions and possible fixes for this problem:
viewtopic.php?f=21&t=75290

BM DNGs are rather unusual and most raw editors can't read them at all, or can't transform color gamut correctly. Some nice apps like Iridient Developer fully support those DNGs, but still can't fully hide moire. Also usually even if you able to filter moire with digital filters, it ends up with jagged edges instead of moire. So i really skeptical that something could digitally replace real OLPF filter. Guess it may work well with Rawlite OLPF, because that filter was designed to preserve sharpness and so it remains some tiny amount of moire in RAW files.

CST gen 4 is OK, but due its too tiny gamut have oversaturation problem in extreme highlights: viewtopic.php?f=2&t=82441#p494793
Problem was fixed in CST Gen 5, but Gen 5 is not available for DNGs: viewtopic.php?f=2&t=82441&start=100#p675964

I personally still prefer to use Gen 1 with Color Checker correction and custom made transformation LUTs described and shared here: viewtopic.php?f=21&t=65149
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostTue Dec 05, 2023 9:55 pm

Hello Dmytro, I received your shipment thanks again!

Raw Therapee is a free, open source photography software which can open BMPCC/BMMCC DNGs and unlike e.g. lightroom, the user can see and control each part of the processing.

Inside the software are a dozen different demosaic options, all of which perform in some ways better than resolve's DNG demosaic method. The trick is that some demosaics have artifacts on their luminance, and others have chroma artifacts. By combining two different demosaics in resolve we will get a really clean, artifact free and high signal to noise ratio image. I'll talk about that in my next post.

Download the software and play with it for a bit, familiarize yourself with how to save profiles, apply them to multiple clips, and do batch exports. My method requires when you open the DNG, make sure all the tools are off on the first several pages. Zero out all the exposure settings. Turn everything off.
Image

Next, turn off the white balance and select "No Profile" on the input profile. Your image is going to look very green. This is the camera's native white balance and color space.
Image

Next go through and set all the profiles to ACES AP0 and the gamma to linear. This is going to let us rebuild the correct color, gamma, and recover highlights inside resolve. The image should look dark and high contrast.
Image

Finally, we come to the raw tab. We have to select a demosaic method. You may want to play with these before turning off white balance and putting it into linear gamma to see how they work.
Image

AMaZE, RCD, and DCB are similar and have chromatic artifacts. LMMSE and IGV are similar and have luminance artifacts. The remaining options are legacy and not worth using.

AMaZE is generally very good, perhaps the single best of the first three options at resolving fine detail.

DCB is about as good as AMaZE, worse at resolving ultra fine detail, but better with edges. It has enhancement steps and I would set them to +5.

LMMSE is the most similar to what resolve uses, but much, much better. It makes noise finer and has virtually no artifacts in high detail areas. Where it does have issues is when two saturated colors are next to eachother, where it will checkerboard and reduce their saturation (called a zipper artifact). It has enhancement steps. I would use +1 if you want to maintain the most amount of chroma detail. +2 through +4 are like applying a light chroma noise reduction. +5 and +6 can cause artifacts.

VNG4 Has one advantage, in that areas with no detail it will greatly reduce noise. It does this by treating the two green channels as one, averaging them. But it also does not resolve detail well.

Both AMaZE and DCB can be combined with VNG4 with a detail threshold for where each will be applied. I found the best threshold to be 9. This usually has it round out the cross-hatching problem, but will not let it round out noise into mush.

Other demosaics are less capable. IGV might be interesting for black and white because it is ridiculously good at resolving detail without artifacts, but has a very desaturated look, and is very prone to zippering.

Image

Border lets you crop the border pixels. By default, the BMPCC crops 16 pixels from each edge of the image. You can set border to 0 to get a 1952x1112 image. The BMMCC does 16 pixels left and right, 12 up and down. Setting the border to 12 with the BMMCC gets you a 1928x1080 image - you actually can't get a 1920x1080 image with this software. Also, you will see that within the 3 pixels at the border are always very artifact prone. There's not much use to having a border less than 3.

False Color Suppression doesn't really work with images that aren't white balanced. And anyway it is like a chroma noise reduction which we can do in resolve later. Leave it at 0.

Black Points are what they sound like. The DNG is written so that black is at a value of 256, which is then loaded as a value of 0 by subtracting 256 from each pixel. But noise can give negative values, and I have found the following values (-7, -8, -8, -6) to better represent true black. Adjusting these numbers also adjust the toe - the contrast in the shadow parts of the image. Interestingly, Resolve seems to adjust this numbers as well.

Preprocessing - Green Equalization will also get rid of the cross-hatching problem at the cost of lowering resolution and potentially causing moire in high detail areas. Cross Hatching is caused because the two green channels of the bayer pattern actually have slightly different gains, with one green channel being a little brighter. This gets noticeable especially at the top end of the sensor, in the highlights at low ISO. Green equalization will average the two green channels if they are within a certain threshold. I found numbers between 25 and 35 work best, but I do not use this setting because it causes artifacts elsewhere.

Image

Chromatic Aberration Correction will greatly reduce moire by lining up the color channels before the debayer. The automatic setting is designed for stills, it is not really usable for video. So you will have to manually set the red and blue numbers by looking at areas of the image with aberration and trying to minimize it. Once you profile a lens it should work on other footage. The "avoid color shift" button seems to work well at preserving colors, I'm not sure if it's better with or without it, it's worth further testing.

Preprocess White Balance should be set to camera to keep it consistent frame to frame.

Capture sharpening at its lowest settings sharpens the image during its demosaic. I found the lowest setting to be harmless but you can turn this off too.

None of the other settings seem worth it. There are dead pixel and hot pixel fixers, line noise reduction etc. But they don't seem to be able to discern image from noise well enough.
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostTue Dec 05, 2023 10:27 pm

I noticed the gamut clipping issue with Gen 4 as well, but I think having actual color science that works with the raw controls below 5000K is pretty invaluable. The other option is to open the DNGs in an ACES timeline which does also have correct transforms for different color temps, and handles gamut clipping, but then you're stuck within ACES.

These cameras, especially the BMMCC, do remind me of shooting on film. People complain about using 3 buttons to access several menus but it's quite familiar. Treat it as an 800ASA daylight stock and just press the 'run' button.
Offline

ShaheedMalik

  • Posts: 676
  • Joined: Wed Aug 19, 2020 5:28 am
  • Real Name: Shaheed Malik

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 12:41 am

Anton_Shavlik wrote:I noticed the gamut clipping issue with Gen 4 as well, but I think having actual color science that works with the raw controls below 5000K is pretty invaluable. The other option is to open the DNGs in an ACES timeline which does also have correct transforms for different color temps, and handles gamut clipping, but then you're stuck within ACES.

These cameras, especially the BMMCC, do remind me of shooting on film. People complain about using 3 buttons to access several menus but it's quite familiar. Treat it as an 800ASA daylight stock and just press the 'run' button.

You can use the ACES transform in a DaVinci Wide Gamut project. I do it all the time.
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 7:28 pm

Those dual de-mosaic methods are very interesting. But here are some thoughts:
In addition to sensor moire/aliasing we may have (or don't have) different de-mosaic artifacts.
RawTherapee seems have very accurate de-mosaic methods.
RawTherapee VNG4 is very very soft in details, so seems like it was designed as special addon to cover flat areas in dual-demosaics.
RawTherapee removes rainbow moire with Chromatic Aberration Correction very well.
RawTherapee can't fully disable color management and can't output files in original color gamut, so we forced output to ACES or something else.
Batch processing for video probably will be slow and intermediate TIFF files will consume a lot of disc space.

From the apps that i use, currently only Iridient Developer and PhotoLine have option to de-mosaic with disabled color management. Both are not freeware.
PhotoLine use LibRaw de-mosaic methods, but don't have dual de-mosaic yet. It can load 3:1 compressed BMMCC DNGs. Input color profile is bad.
Iridient Developer use own proprietary methods and probably use some variation of dual de-mosaic. It can NOT load 3:1 compressed BMMCC DNGs. Input color profile is great and it can transform tonal curve correctly without additional adjustments. I personally use it only to demosaic X-Trans sensor, because it somehow creates way more real fine details than LibRaw's Markesteijn. Iridient Developer also use it's own input camera profiles which are subjectively better looking than LibRaw's.
There is also nice LibRaw based free app - darktable, but it can't read BMMCC DNGs at all.

Here are some tests. Color and contrast are slightly different because in different apps i used different methods to transform color and gamma. No Sharpening:
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Last edited by Dmytro Shijan on Wed Dec 06, 2023 10:52 pm, edited 3 times in total.
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

iaburn

  • Posts: 8
  • Joined: Wed Nov 15, 2023 10:42 am
  • Real Name: Eduardo Añibarro

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 7:48 pm

Dmytro Shijan wrote:Here are some tests. Color and contrast are slightly different because in different apps i used different methods to transform color and gamma. No Sharpening:


Thanks a lot for taking the time to test them all! Would it be possible for you to share the DNG that you used on those tests? :?:
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 7:57 pm

It is Howard Roll's DNG from this Dropbox folder https://www.dropbox.com/sh/u9a3t5j3dgxw ... mpb8a?dl=0 (In early days i collected some BMMCC DNG samples shared online by different users)
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

Michel Rabe

  • Posts: 647
  • Joined: Thu Aug 29, 2013 8:06 pm

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 8:23 pm

AMaZE+VNG4 looks great. A good test from Howard's Dropbox is this image, it has some nasty artifacts.

01.jpg
01.jpg (402.12 KiB) Viewed 4959 times
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 8:25 pm

IIRC DCB is the only demosaic to not artifac on that image. That one happens to be 3:1 compressed and I find those have more artifacts.

I've also been using those dngs, plus shooting several of my own and trying to find a result which works the best in all situations, since there are lots of kinds of artifacts. What works best on those focus trumpets might still have trouble elsewhere, and I think using DCB+VNG4 as luma and LMMSE as chroma overall has very mild artifacts.

Take this image for example
Image

Here's resolve's debayer
Image

Here's my method, which leaves a little moire
Image

And here's IGV debayer alone, which seems to reproduce all the detail, but has big problems elsewhere.
Image

If I was just looking at this one part of one image I'd just use IGV and be done. It's good to test and pixel peep as much as you can.
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 8:37 pm

Yes, a lot of those examples have strong artifacts. That was the main reason to collect them.
If someone interested i also have someones DNGs from Mosaic OLPF test with EXTREME rainbow moire: https://www.dropbox.com/sh/mo1kr2ddz241 ... t1vPa?dl=0
And my own Cross-Hatching test DNGs:
https://www.dropbox.com/sh/w9vgckt4bwhz ... FxVCa?dl=0
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

iaburn

  • Posts: 8
  • Joined: Wed Nov 15, 2023 10:42 am
  • Real Name: Eduardo Añibarro

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:10 pm

Dmytro Shijan wrote:Yes, a lot of those examples have strong artifacts. That was the main reason to collect them.
If someone interested i also have someones DNGs from Mosaic OLPF test with EXTREME rainbow moire: https://www.dropbox.com/sh/mo1kr2ddz241 ... t1vPa?dl=0
And my own Cross-Hatching test DNGs:
https://www.dropbox.com/sh/w9vgckt4bwhz ... FxVCa?dl=0


Thanks for the samples. I tried the "Raw details" filter in Photoshop on your jacket example, and it only leaves minimal color noise. Night and day difference:
original.jpg
Original
original.jpg (441.34 KiB) Viewed 4905 times

rawdetails.jpg
Raw details filter
rawdetails.jpg (384.1 KiB) Viewed 4905 times
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:14 pm

It will not help. In motion instead of rainbow dancing stripes you now have gray dancing stripes :) Also all those filters usually kill other saturated colors and real small colored details as well.
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

iaburn

  • Posts: 8
  • Joined: Wed Nov 15, 2023 10:42 am
  • Real Name: Eduardo Añibarro

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:26 pm

Dmytro Shijan wrote:It will not help. In motion instead of rainbow dancing stripes you now have gray dancing stripes :) Also all those filters usually kill other saturated colors and real small colored details as well.


This "filter" is not really the typical filter, I think there is some AI involved.
I use it a lot on my photos and it can really bring detail when there seem to be just aliasing artifacts.

If someone have a challenging scene and want to share a few seconds, I'm happy to give it a try :)
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:27 pm

BTW, i processed few normal stills in Iridient Developer and must say it have very nice color compare to default Resolve input profile and CST. No any additioinal LUTs or custom calibration applied. Only recovered some highlights. But anyway, it can't remove that classic BM aliasing. Probably its de-mosaic methods mostly designed high megapixel sensors to reveal details. It also remains some cross-hatching pattern. v4 smooths cross-hatch pattern, but also smooths a lot of grain as well.
Image
Image
Image
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:40 pm

iaburn wrote:If someone have a challenging scene and want to share a few seconds, I'm happy to give it a try :)

I can look at my archives and upload some short tests of charts with and without OLPF. No movement, just slow in/out focus. But they all use DNG 3:1 compression. Can Adobe read it?

Rawlite also have example DNG sequence at their website.
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

iaburn

  • Posts: 8
  • Joined: Wed Nov 15, 2023 10:42 am
  • Real Name: Eduardo Añibarro

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:44 pm

Dmytro Shijan wrote:But they all use DNG 3:1 compression. Can Adobe read it?


I'm afraid not... I'll can try to record some samples myself :idea:
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:51 pm

There are some issues with using 3rd party software. Raw Therapee at least has good support for most of the issues except the following - Resolve has excellent highlight recovery that works in motion, I think I have solved this though, I'll share in a bit.

I have also found that almost every software just loads the D65 matrix and so footage shot below ~5000k will have noticeably skewed colors, and more skewed the lower kelvin you go. Seeing that Gen 4 color science actually tweaks the matrix for each color temp is a big revelation - it's a feature you should really want. So I need to shoot some test charts to create some alternative matrices.

Image

Image
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 10:57 pm

Small note:
Iridient Developer can NOT read 3:1 compressed BMMCC DNGs. But color is great.
PhotoLine and other LibRaw-based apps CAN read 3:1 compressed BMMCC DNGs. But input color profile is bad and also they miss some intermediate log curve metadata and so can't transform tonal range correctly without manual curve adjustment.
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 11:11 pm

Anton_Shavlik wrote:There are some issues with using 3rd party software. Raw Therapee at least has good support for most of the issues except the following - Resolve has excellent highlight recovery that works in motion, I think I have solved this though, I'll share in a bit.


BM DNGs are rather unusual. To save file size they pack RAW data in 12 bit Log. So software should apply special log-to-linear curve when import files and convert them to 16 bit Linear. LibRaw apps seems skip this step and simply apply linear curve same as to any other normal RAW files. So we need to apply by guess some curve manually to make thins work as expected.
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 11:15 pm

The difficulty with recovering highlights is that after the image has had the color science applied, there's going to be channel mixing. It's just how color science works.

So a clipped highlight on the sensor will not necessarily be a flat white line unless the output is clamped to white, which is what resolve does when the 'Highlight Recovery' box isn't checked. If any color channel clips, just clip the others too.

When you press 'Highlight Recovery' resolve is taking the raw data, maybe even before the demosaic, and guessing what the clipped channel would have done. You can make a guess that the clipped channel must actually have been brighter than what was recorded, so you need to 'add' some combination of the other channels.

Because the BMPCC/BMMCC sensor exposes the green channel 2/3 of a stop brighter, it will almost always be the green channel that clips first.

Here's an example -
Image
This is the camera native, in linear gamma. When channels clip, the green typically clips first, which means -

Image
When we bring things back, the highlights will clip to magenta. But we can also see the sky smoothly shifting hue toward magenta as it gets near the horizon.

Image
We have to take the clipped portions of channels and combine them, and then replace the clipped channels only where the combined highlights are brighter than what was there originally. It takes tweaking to get the combined color channels to work well across all footage.

Image
After that we apply the white balance, color science, and gain.

Image
And we get back an image that looks quite believable, with realistically warm colors in the recovered highlights on the building, while maintaining blue tones in the recovered parts of the sky. I found this method to be about as good as what is built into resolve.

The hard thing about these cameras is that they don't clip directly to white, they kinda clip into a fixed sensor pattern which is uneven and non-linear, making it very hard to pull good keys from the highlights in the raw sensor data after demosaic. You could try to grab a little lower than the clipped area but then you will loose color detail in the high end that actually is completely unclipped, just to make the transition smoother.
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostWed Dec 06, 2023 11:22 pm

the DNGs should have the linearization table written in them, a LUT that turns the log encoded 12 bit data into linear 16 bit (I assume) data. Just like they have a D65 matrix and a 2850K matrix for converting the sensor colors into XYZ D50. There's information for which linear value is black and which value is white, timecode, and what white balance, frame rate, and ISO were used. The DNG also instructs what resolution to open itself as, and which pixels to cut off. It doesn't really specify anything else tho.

I'm thinking raw coverters are just loading what is inside the DNG, while maybe Resolve can load something more accurate since it sees its own camera?
Offline
User avatar

Jamie LeJeune

  • Posts: 2008
  • Joined: Tue Feb 26, 2013 4:33 am
  • Location: San Francisco

Re: Inside BMPCC DNG & A Better Demosaic

PostThu Dec 07, 2023 4:05 am

Dmytro Shijan wrote: BM DNGs are rather unusual. To save file size they pack RAW data in 12 bit Log.
Unusual for DNG, but not so unusual for a cinema camera. ARRIRAW works the same way.
www.cinedocs.com
http://www.imdb.com/name/nm4601572/
Offline

ShaheedMalik

  • Posts: 676
  • Joined: Wed Aug 19, 2020 5:28 am
  • Real Name: Shaheed Malik

Re: Inside BMPCC DNG & A Better Demosaic

PostThu Dec 07, 2023 4:27 am

Jamie LeJeune wrote:
Dmytro Shijan wrote: BM DNGs are rather unusual. To save file size they pack RAW data in 12 bit Log.
Unusual for DNG, but not so unusual for a cinema camera. ARRIRAW works the same way.

BRAW too.
Offline

John Brawley

  • Posts: 4257
  • Joined: Tue Aug 21, 2012 7:57 am
  • Location: Los Angeles California

Re: Inside BMPCC DNG & A Better Demosaic

PostThu Dec 07, 2023 4:52 am

Dmytro Shijan wrote:
Anton_Shavlik wrote:There are some issues with using 3rd party software. Raw Therapee at least has good support for most of the issues except the following - Resolve has excellent highlight recovery that works in motion, I think I have solved this though, I'll share in a bit.


BM DNGs are rather unusual. To save file size they pack RAW data in 12 bit Log. So software should apply special log-to-linear curve when import files and convert them to 16 bit Linear. LibRaw apps seems skip this step and simply apply linear curve same as to any other normal RAW files. So we need to apply by guess some curve manually to make thins work as expected.


Huh??

Arri would like a word. So would Sigma.

Both are 12bit log encoded. Always.

Also Convergent Design made a DNG monitor recorder that recorded the raw output of cameras like c300 mk2 and fs7 as you know…12bit cDNG!?!?

Maybe you’re confusing DNG from a photo camera?

JB
John Brawley ACS
Cinematographer
Currently - Los Angeles
Offline
User avatar

Alex Mitchell

  • Posts: 189
  • Joined: Tue Mar 18, 2014 5:32 pm

Re: Inside BMPCC DNG & A Better Demosaic

PostThu Dec 07, 2023 8:32 am

Dmytro Shijan wrote:Yes, a lot of those examples have strong artifacts. That was the main reason to collect them.
If someone interested i also have someones DNGs from Mosaic OLPF test with EXTREME rainbow moire: https://www.dropbox.com/sh/mo1kr2ddz241 ... t1vPa?dl=0
And my own Cross-Hatching test DNGs:
https://www.dropbox.com/sh/w9vgckt4bwhz ... FxVCa?dl=0


Oh hey! My jacket shot is making the rounds again, LOL. Always nice to be remembered. ;)
Offline

CaptainHook

Blackmagic Design

  • Posts: 2054
  • Joined: Wed Aug 22, 2012 4:50 am
  • Location: Melbourne, Australia
  • Real Name: Hook

Re: Inside BMPCC DNG & A Better Demosaic

PostThu Dec 07, 2023 10:09 pm

Storing non-linear in DNG is not unusual, but part of the spec. And not uniquely for CinemaDNG either but the standard "stills" DNG spec:
LinearizationTable describes a lookup table that maps stored values into linear values. This tag is typically used to increase compression ratios by storing the raw data in a non-linear, more visually uniform space with fewer total encoding levels.
Linearization
The first step is to process the raw values through the look-up table specified by the LinearizationTable tag, if any.

If an app does not support it then it does not fully support the DNG spec. Its also listed as mandatory to support the LinearizationTable tag in the CinemaDNG spec.

FYI CinemaDNG which Resolve supports is a subset of DNG, so not all DNG features/tags that stills based cameras may use are supported in Resolve as those are not mandatory in the cDNG spec.
**Any post by me prior to Aug 2014 was before i started working for Blackmagic**
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 08, 2023 12:47 am

There are some nice examples and explanations of RawTherapee methods here: https://rawpedia.rawtherapee.com/Demosaicing

DCB
DCB produces similar results to AMaZE. AMaZE can often be slightly superior in recovering details, while DCB can be better at avoiding false colors especially in images from cameras without anti-aliasing filters.

LMMSE and IGV
These are recommended when working with very noisy, high ISO images, in conjunction with the Noise Reduction tool. They will prevent false maze patterns from appearing, and prevent the image from looking washed-out due to heavy noise reduction. IGV is also quite effective at mitigating moiré patterns.

VNG4
If you use a medium format technical camera with near-symmetrical wide angle lenses such as the Schneider Digitar 28mm or 35mm it's likely that the image captured by your sensor will contain some crosstalk between photosites, especially if the lens is shifted (due to the low angle of incoming light from these lenses some light leaks over to the next pixel on the sensor), and in this case you can get mazing artifacts with AMaZE and DCB because of the green channel separation caused by the crosstalk. If you combine a mirrorless camera using an adapter with a wide angle lens designed for film, you may also get crosstalk. It can then be better to use the VNG4 algorithm (Variable Number of Gradients), which handles this situation well, at the cost of some fine detail. An alternative is to enable green equilibration to even-out the green channel differences.

There is also some info about LibRaw methods here: https://www.libraw.org/node/2306
They declare: "DHT is the best choice for image quality, and one of the better choices for speed" but DHT amplifies aliasing a lot, so it is not for BMMCC DNGs.
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 08, 2023 2:58 am

I found DCB better suited for motion because it finds edges better. Amaze finds detail but isn't as consistent frame to frame.

LMMSE and IGV both hide color aliasing but have zippering artifacts in their place. IGV does not resolve color very well. (And it's true that the noise with these debayers is more like film grain, random, about the size of a pixel, and not very chromatic.)

For example, on this image

Image

DCB has nice edges but lots of color artifacting.

Image

LMMSE, instead of color artifacting, has this checkerboard 'zippering' where colors transition;

Image

IGV has vritually no color artifacting, but it has the zippering too, and I think IGV goes too far. Here's IGV on a stoplight

Image

and here's LMMSE with +1 enhancement

Image

So what I do is actually make 2 TIFF sequences. one with DCB+VNG4 and one with LMMSE. Then I layer them with the LMMSE on top, and set the blend mode to 'color'. This gets the nice colors of LMMSE and the nice edges of DCB.

It's very tedious but if you really want to get all the image out of this camera, this is the best way.
Offline

Anton_Shavlik

  • Posts: 40
  • Joined: Sat Nov 25, 2023 1:09 am
  • Real Name: Anton Shavlik

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 08, 2023 3:09 am

From the same image -

LMMSE
Image

AMaZE
Image

DCB
Image

DCB is clearly resolving 'real' detail more accurately which makes it more consistent frame to frame

And when I overlay LMMSE on DCB using 'color' blending

Image
Offline
User avatar

Dmytro Shijan

  • Posts: 1760
  • Joined: Wed Sep 17, 2014 7:15 pm
  • Location: UA

Re: Inside BMPCC DNG & A Better Demosaic

PostFri Dec 08, 2023 3:20 am

Anton_Shavlik wrote:So what I do is actually make 2 TIFF sequences. one with DCB+VNG4 and one with LMMSE. Then I layer them with the LMMSE on top, and set the blend mode to 'color'. This gets the nice colors of LMMSE and the nice edges of DCB.
It's very tedious but if you really want to get all the image out of this camera, this is the best way.

triple de-mosaic :shock:
BMMCC/BMMSC Rigs Collection https://bmmccrigs.tumblr.com
My custom made accessories for BMMCC/BMMSC https://lavky.com/radioproektor/
Next

Return to Cinematography

Who is online

Users browsing this forum: Csaba Nagy and 14 guests