Flat-Field correction & pattern noise



After I learned that my camera is prone to artifacts with backlit photos, I started to examine my photos more closely. Now I have a question regarding Flat-Field correction in RawTherapee.

When applying a FF correction, I have to use Blur type: Horizontal, otherwise the correction image is not aligned with the actual photograph I want to correct. How come? Is it related to the image rotation? I always thought rotations are done by the software based in exif data.

Horizontal always seem to work and remove vignetting, but also introduces a weird pattern in the noise, even at ISO 200, similar to a crosshatch pattern:

Anything I can do about it? Could this be related to the fact that it’s a X-Trans file?

(Ingo Weyrich) #2

Can you provide a flatfield shot and a raf it should be applied to please?
I will have a look then.


Sure, here they are. Thanks! DSCF3567.RAF (22.6 MB)
smc-pentax-a-50mm-f2.8.RAF (21.8 MB)

RawTherapee 5.5 auto-matched tone curve very light?
(Ingo Weyrich) #4

That’s easy to fix. It’s caused by some garbage columns in your raf files. You need to modify your camconst.json to crop them out. Then using ‘Area’ in Flatfield works just fine.

In your camconst.json search for ‘X-T2’ and remove it from that section which then should look so:

    { // Quality B
        "make_model": [ "FUJIFILM X-PRO2", "FUJIFILM X100F", "FUJIFILM X-T20" ],
        "dcraw_matrix": [ 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 ], // DNG_v9.4 D65
        //"raw_crop": [ 0, 0, 6032, 4032 ], // full raw 6160,4032, Usable 6032,4032 - experimental crop
        "ranges": { "white": 16100 }

Then, immediately after that section, add this new section:

    { // Quality B
        "make_model": [ "FUJIFILM X-T2" ],
        "dcraw_matrix": [ 11434,-4948,-1210,-3746,12042,1903,-666,1479,5235 ], // DNG_v9.4 D65
        "raw_crop": [ 0, 5, 6032, 4032 ], // full raw 6160,4032, Usable 6032,4032 - experimental crop
        "ranges": { "white": 16100 }

At next start of RT you can use ‘Area’ without issues.

(Ingo Weyrich) #5

Here’s s screenshot made with a modified version of RT to show you the garbage at the border

Edit: With the modified camconst.json entry you can also use the auto-matched tonecurve without issues.

With the old entry I got this result for your file:

With the new entry I get this:


Very cool, it works!

Is there a way to get this working with user camconst.json? Tried it, but it only worked when directly editing RT camconst.json. Probably because it does not add something new but instead overwrites an existing entry?

(Ingo Weyrich) #7

user camconst.json should have precedence…
Anyway, I just pushed the fix. X-T20 had the same issue. Will be in next nightly build then.

(Ingo Weyrich) #8

It’s a bit more tricky than I thought. The raw crop in camconst.json works fine for lossless compressed files from X-T2 and X-T20, but not for uncompressed files…

I guess the majority will use lossless compressed files, which is why I set it as default. But I also just added 2 alternatives to camconst.json

(Sebastien Guyader) #9

Does it mean data are compromsied in (maybe not so) lossless raw files, or that the algorithm for decompressing is faulty?

(Ingo Weyrich) #10

I don’t think so. The full usable area for both modes has the same size. It’s just different offsets for some cameras.
For the X-T3 the offsets are the same for both modes, which is an indicator, that it’s no fault in the decompression.