Dealing with clipped highlights — using raw white point

It is the small addition to this topic — Dealing with clipped highlights - an example , my way of dealing with clipping.

  1. I have a raw file with clipped sky (sometimes it happens :wink: ):

  2. I apply my profile (just a camera profile for this example):

  3. I change raw white point (0.3 for this example), clipped areas become pink:

  4. Highlights reconstruction → Color propagation. Here we are:

6 Likes

Fantastic, thanks for sharing.

@patdavid I think I’m going to turn this, combined with @Morgan_Hardwood’s post into an article at some point. I’ve wanted to put together a catalog of techniques grouped by scenario.

4 Likes

That’s a great idea!

Your example is a good one. I am dealing severely clipped highlights exactly the same way as you are. Pulling down exposure gives pretty much similar results so I am usually trying it out too. If one doesn’t touch exposure or raw white point, one can get really awful colors if one uses only highlight reconstruction & compression: contrast is almost totally lost in the very high end. Better to combine them.

Sometimes tonemapping with strength >= 0.01 and gamma > 1 is also a handy tool: opens shadows and compresses highlights.

RT doesn’t have any kind of support for masks, but it isn’t really a problem: one can combine multiple 16 bit tiffs in Gimp which supports any mask you can imagine and sports many blending modes for layers. In the case of clipped images it can be a really good idea: in general one doesn’t want skin or sky to clip, but it is ok to clip pointlike or just small light sources like candles, lights etc. With masks it is easy to preserve clipping where it is justified.

1 Like

@LZ1 please upload the raw file + PP3 + input profile.

Zip-file is here.

That is true, though I would consider that to be a quick workaround - a plaster on a cut. The proper, permanent fix is to set the correct white levels in camconst.json

This raw files comes from a Nikon D200. It has no camconst.json entry, but the white levels used from dcraw are almost correct.*

The red channel is not clipped in the sky or skin in this raw photo, only the green and blue channels are clipped. There is no need to lower the raw white points - highlights can be cleanly recovered using color propagation:

The image tones and colors look horrible and the histogram spikes when the ICC profile is applied:

Examining the ICC file shows that it does bad things near white:

Setting white point correction to -0.3 does lead to an improvement in colors:

But the whole way of going about this seems counter-productive: using this bad ICC profile creates the problem, then you use raw white points to hack around it. Solution: Ditch the bad ICC profile and use curves.

Lowering the raw white points could lead to other issues I haven’t looked into here, such as demosaicing artifacts, problems with flat-fields, etc.


* I measured the white levels to be R=4095 G1=4095 B=3999 G2=4092, while dcraw uses 4028 for all.

    {
        "make_model": "Nikon D200",
        "dcraw_matrix": [ 8367,-2248,-763,-8758,16447,2422,-1527,1550,8053 ],
        "ranges": { "black": 0, "white": [ 16383, 16383, 15999, 16370 ] } // WL typical 16383 set to 16300 for safety
    },
4 Likes

Hi Morgan_Hardwood,
where the icc curves come from ??

@dafrasaga DisplayCAL.
http://rawpedia.rawtherapee.com/How_to_extract_and_examine_ICC_profiles

Forgive my ignorance. Is the ICC profile referred to in this thread the Input (camera) profile selected in RT?

@Morgan_Hardwood[quote=“Morgan_Hardwood, post:7, topic:3547”]

  • I measured the white levels to be R=4095 G1=4095 B=3999 G2=4092, while dcraw uses 4028 for all.

    {
    “make_model”: “Nikon D200”,
    “dcraw_matrix”: [ 8367,-2248,-763,-8758,16447,2422,-1527,1550,8053 ],
    “ranges”: { “black”: 0, “white”: [ 16383, 16383, 15999, 16370 ] } // WL typical 16383 set to 16300 for safety
    },
    [/quote]

Do the white values represent the maximum value attained in each channel at saturation? e.g. as measured in RawDigger.?

Yes, it’s in the zip file.

Yes, but only for this photo. To add proper support a whole set would have to be measured as described in Adding Support for New Raw Formats - RawPedia

In fact, this is the one of native Nikon D200’s profiles extracted from NXD (as described here ).

I like them because I usually get good result without additional efforts.