Camera Profiling with Darktable-chart

Matching RAW to in camera JPG

In a previous episode I used dt-curve-tool to build basecurves that match up the tone of your RAW with the in-camera JPG. In this episode I use an it8 color chart and darktable-chart to add color to the equation. I show how you can build a database of ISO settings for your camera body to generate a starting point for processing that closely approximates the in-camera JPG. You're going to need a color target to do this. Here is the cht file I used in this video.

This is an advanced concept, like the Base Curves episode, so we've provided a carefully transcribed and matched version of the text in subtitles on the video.

This video is the latest in our faster format but packed with information. It builds on knowledge from previous videos, running full-tilt through tools and methods to achieve the goals. For fuller explanations, return to the Home Page and scroll down to Topics Discussed or Modules Used on the right-hand bar. Click on any of these, and we assemble a complete playlist of every instance from a knowledge base of our first 27 videos for quick review right here on the site.
Thank you for watching!

Complete show text

Download complete text here

Aloha and welcome to another episode of Weekly Edit.

Things have been getting a little busy around here.

I wasn't able to get to an episode last week, but I've got a good one this week.

I'm looking at color profiling my camera.

A couple episodes ago I looked at making Base Curves, which basically tries to match your RAW image to your in-camera jpg in terms of the L Channel, the luminosity.

This week I'm using an it8 target, which is a color chart, and I'll use an application called darktable-chart to map the color patches on the RAW image out of my camera with the in-camera jpg.

There are a couple things we need to do in order to make this happen.

You'll have to pay the money and get a good target.

There are some cheap ones out there and they have terrible reviews.

People say they just don't work.

Evidently the inks on this target are supposed to be such that they maintain their reference proportionality to each other under a variety of lighting conditions, but nonetheless, they recommend that you shoot this target in mid-day sunny conditions.

It was a little cloudy, and it's hard to get a sunny day around here, so we're doing this episode with the best I have.

I've noticed that I get better results if I match the ISO.

My color profiling changes a little bit with ISO, so I'm going to take the time personally and shoot at different ISOs and make color mappings for each ISO, just like I did with base curves.

What we want to do is have a RAW and a jpg of our color target, so you'll have to change in your camera to do that.

And I want to have the white swatch down here be around an L92.

So, I shot at a variety of exposures and then I'll use the Color Picker tool on Mean and look at the luminosity.

This one is around 90 and I shot this one at 1/20th of a second.

This one here I shot at 1/15 second.

Let's see what the L value is on that one.

That's 98; that's a little hot.

I'm not going to use that one; I'll use the previous one.

Now, notice my History is blank: SUPER-IMPORTANT.

So, we'll use this one and the matching jpg.

This is ISO 100.

We'll generate a Color Lookup Table mapping that will match these two, so I'll label this when I'm done with the name of the camera body, so that profile is determinate, and the ISO.

Then, when I'm done with this big project, I'll have made a value for each camera body and each ISO that I shoot at.

Maybe I'll break it up a little bit, but I want to have various values; I don't want to just have a couple.

Okay, I'll crop this.

I don't have to, but I find it easier to work in darktable-chart if this is cropped a bit first.

I don't need to worry about keystoning here; I can fix it later.

I want to apply a similar crop to my jpg so I'll copy and paste this over all of these.

There we go.

Now there are two places I can set the Output Color Profile.

I'm going to want to do that because I was getting indeterminate results when I only set it at the Export function.

So, I'm setting this in Output Color Profile to Lab and I'm setting it in the Export Settings to Lab.

So, File Format is .pfm The reason we're converting this and the jpg to pfm is that's the file format the darktable-chart program wants to see the files in.

Profile is Lab; Intent is Image Settings.

I'll Export that one.

Then I'll take this jpg and set it up as Lab, and set its Export to Lab also.

Okay, something I forgot to go over: there's an rc file associated with Darktable that requires an entry in order for that pfm output using the Lab color space to work properly.

That's located in .config/darktable/darktablerc and it's this line right here: allow lab_output=true If you put this line in this file while Darktable is open, then Darktable will over-write this rc file when Darktable closes.

That's how it stores whatever session options you set.

So, you need to make sure you close Darktable first, open this rc file, add that line, close it, and then you can open Darktable again.

This part here, where I exported these as a PFM only worked because I had added that line previously.

This is the one I ended up buying.

I got this one in the little plastic case because I could include it in my camera bag.

I found that, if I took a shot of this and used it with my white-balance tool, I got pretty good results for adjusting my white balance.

So, it seemed like it was convenient to take with me.

There's also an 18% grey card on the next page over, and it's all plastic, so that seemed like the best one.

Okay, I'm going to need this .cht file.

What the .cht file is, is it's information about what colors are located where on that Color Checker Passport.

I'll include a link to this file in my webpage at Also, you can just look around the internet and get it.

Okay, now we'll open darktable-chart.

This has three tabs: Source Image, Reference Values, and Process means make the mappings.

So, on the first tab there's two places: image and chart.

And it's a little different on the Reference Values; you'll see.

Okay, so we made those pfm files.

This was the first one.

This was my RAW image.

Then I'm going to apply that chart file.

See, it's just got these squares and it's got reference colors.

We grab the corner and align it so that the little squares inside the bigger squares only touch the colors that they're supposed to; they don't touch any of the edges.

That is pretty important.

If you need to, to get it to work, you can adjust the Size of the squares.

This is a little backwards: the lower you make this Size, the bigger the squares, and the larger the Size, the smaller the squares.

You pretty much want to make the squares be as big as possible but not have them touch any of the edges.

That looks pretty good.

I'm good and safe there.

Then, on this next tab, Reference Values, here is where we align the jpg.

So, where it says Mode, we have to change this.

We go to 'color chart image'.

Then this time we select the file on the right-hand side instead of the left.

So, under Reference Image, we'll pick the pfm of the jpg.

Then we have to align this one too.

There we go.

I'm double-checking all my squares.

Look at them and make sure none of them -- like, see, this one is on the edge and that one is on the edge, but they look okay.

Then I go to Process: 'patches with gray ramp' There we go.

I like this one: SAT1...SAT8.

'number of final patches' - I did not get good results at 24; I thought 48 was much better.

And then 'process', and it goes.

And now 'export' We'll save these.

and they save them as 'styles' Now we can go into Darktable.

Under Styles in the Lighttable view, Import, and there we are.

There's our style.

Now we'll apply that style to an image.

This one was shot at 100 ISO.

Okay, so we click on the image and we double-click on the style.

Alternatively, you can open the image and go down here and select the style, and it will apply it.

See what it applied here? It applied a color lookup table entry and a Tone Curve entry.

Let's look at the jpgs right next to it.

Here's the jpg, okay, and here's the RAW with the changes made.

It looks pretty good.

It looks kindof close; it's not perfect.

The L Channel looks like it could use a little work, but the colors are close, and it's a lot better than the original RAW.

There's the original RAW and the jpg, and here's with the changes.

So, here's what we can do.

We can come over here to Color Look Up Table and we can say 'store new preset' I'll call it my camera body name and the ISO.

Then it will auto-apply this each time.

Oops - one change there: only RAW images.

There we go.

There's also an entry here under Tone Curve, and I would do the same thing: I would set a pre-set and tell it to auto-apply.

You can see this one didn't use the Base Curve, because the Base Curve is specifically set (off) and it makes the changes in the Tone Curve instead.

Okay, that was at 100 ISO; let's find one at 3200 ISO, because I said I wanted to do these for various ISOs.

This should go a lot quicker.

Now, we're looking for the white here to be around 92, so I take my Color Picker and I check it.

That one's at 73; that's not even close.

Okay, this one was shot at 1/1000 second and this one at 1/800, this one at a 1/640.

Oh, that's better; it's up to 87.

This next one here was shot at 1/500 second.

Let's see that one.

These are generally going to run around +1 to +2 on your exposure.

That one's at 95; I think that's fine.

Let's use that one.

Don't forget: we've got to go in here and change our Output color Profile to Lab, and same thing with the adjacent jpg.

We'll take these two and make a .pfm So: PFM; Lab; Image Settings: go! Okay.

Now we'll change this pfm image to this new one we just did.

I know this is silly, but you've got to re-select this.

If you don't, at least on my version, it won't give you this option at the end to 'process' So, I re-select it, and then re-align it.

I make those squares a little bigger by pulling this slider down.

Make sure I'm not over the edge anywhere; this is a little close, so I'll pull this end up a little.

Check all your squares.

Make sure they're all good.

Okay, we're good.

Now we go on to the second one, which is the one we made from the jpg, and then align this again.

We'll make these squares a little bigger too.

Are they all good? Everything's good? Oh, that one's close; let's pull that up a little.

Okay, we're good everywhere.

Then we go to Process: SAT1...SAT8; 48; hit 'process' and then 'export' Okay.

Now we'll come in here in Darktable.

Go to Styles; Import, and our new style should be there.

This is the one for 3200 ISO so we'll apply it to this image here which was shot at 3200 ISO.

Then when we look at it and the jpg, they look pretty close too.

Here was our original and that's the jpg.

Here's with the changes made, and there's the jpg; that's pretty close too.

But, I have found that I can get even closer.

The way I can get even closer is by applying the custom Base Curves that I built in a previous episode, before I export this RAW as a pfm.

So, let's give that a shot.

I want to warn you, it specifically says that you're not supposed to do this in the Darktable manual.

But I get better results, and I'm interested in results, so that's what I'm going to do.

We'll change this back to RGB and we're going to apply the Base Curve to this that's appropriate for 3200.

I think 5000 is probably the right one.


Now, this is important: you've got to re-check your L level after the Base Curve.

And look: we're up at 99.

Not good! Okay, so we've got to go back to one that had a faster shutter speed because we're applying the Base Curve now.

So, the previous one was shot at 1/640 second.

Let's apply that Base Curve again and check it.

97: we're still way up there.

So, let's go way back to this one.

Here we are: 1/1000 second.

Apply our Base Curve and check it: 92; that's pretty close.

So, we're going to take this one, we're going to change the Color Output to Lab.

We're going to go to the next image, which is the corresponding jpg; we're going to change it to Lab.

We're going to take this two, export them as pfms.

There we go: Bingo! Go into this program, and we'll knock this thing out.

Source Image.

There we go.

Oh, I forgot: I've got to re-import this.

Otherwise, I will just be wasting my time.

Okay, now don't forget: what's different with this one is we started by applying a Base Curve image to it.

I'm checking all of my squares.

Okay, now the corresponding jpg to this one.

I'm checking all my squares to make sure they're exclusively on the color I want.

Okay, that all looks good.

Now: Process.

There we go, and 'process' and 'export' Now we're going to take the shot at 3200 ISO and apply that style to it.

So, we'll need to import it and we need to apply it by double-clicking on it.

Now, this time, remember we added the Base Curve before we exported it as a pfm, so we need to re-add that Base Curve to complete the calculations here.

There we go.

That's the jpg and that's the RAW with the Base Curve applied first.

They are very, very close.

Wow, that was a lot.

Everybody, have a great week.

You can refer to the show notes, and I'll try to include relevant information there.

See you all later.