Hello,
I am looking at the original sensor pattern for different cameras. The output seems perfectly reasonable for X-Trans sensors and for the one camera I have that has a Bayer sensor CFA but outputs DNG RAW files (a Insta360 One R).
But when I look at files captured with my former Pentax and Olympus cameras (all Bayer CFA) I see a strange macroscopic pattern as in the attachment. That pattern is only visible when you zoom in: if you look at the whole image it is not visible and the output seems reasonable.
Any explanation? is it a bug in RawTherapee or rather a real artifact produced by some sensors?
Thanks!
Paolo
Any patterns you see not associated with the CFA layout are due to the zoom ratio and how the pre-demosaic image is encoded. In my software when I read in a raw file, I read the individual sensel values into all three channels of a RGB pixel, so my pre-demosaics all look monochrome. When I zoom out, the resize translations make large “blocks”.
To actually “see” red, green and blue values for the Bayer array, I had to write a special mode into my demosaic tool to color the pixels accordingly. Here’s what I see using it at 900% zoom:
What you’d expect.
However, when I use “fit” mode, where the internal image is resized to fit the window, I get this:
Note the blocky pattern introduced by the resize. Then, I spent some quality time dragging the bottom-right corner of the program window around, where the “fit” mode follows the changing window size. Doing, this, it’s apparent the degree of blocky-ness depends on the resize size; at the extreme I got this:
I would have posted sooner, but i spent about a half an hour dragging the window corner around and regarding the psychedelic pattern change… 
So, I’d say meaningful consideration of the mosaic doesn’t happen at resize ratios less than 100%…
Glenn,
thanks a lot for your time!
The kind of pattern you see in your second image is the result of aliasing at different zoom levels with the display resolution. It is very regular along x and y directions and it shows up only at certain zoom levels. If I’m right it should NOT be image-locked, in the sense that the pattern should “move” relative to image features as you pan around.
What I am experiencing, I think, is different:
- the pattern is not regular, it rather has a checkerboard stricture in the middle of the picture and a more “swirly” appearing along the corners, where greener spots appear elongated;
- the pattern shows up from a certain zoom level on: it is not evident at 100% fit, then boom it shows at some point as you zoom in (at about 3x, but it depends on the camera), and it remains there (locked to picture features!) even when one sensel takes 10x10 screen pixels (or more)
See some examples:
Center zone: pattern seems regular checkerboard:
Corner zone, notice the elongation of predominantly green areas:
Zoom in:
Enlarged detail of the taxi:
I am gonna try and fetch a NEF file from DPReview, just to see if camera maker makes any difference.
I can confirm that NEF files do not show this pattern, at any magnification. So far, I can only replicate it on Pentax Raw files. The other Bayer camera I have is a GFX100s, but RawTherapee seems can’t open those files (all black).
-P.
The irregular pattern may come from either CA correction or lens correction. Have you tried to deactivate them?
In you screenshot I see CA correction active 
Hello Hansgeorg and thanks,
but nope: I tried to deactivate CA correction and nothing changes (well, actually some pixels along the sharp corners change a little, of course).
I can also add that the same pattern appears on Olympus raw files (ORF), where it’s possibly more spectacular.
It would be excellent if you could share a problematic raw file.
And, a .xmp of the processing that produced that rendition. I really think it’s something in your processing toolchain…
You’re right, much better to share. There’s no XMP file, though: I get the pattern as soon as I open ANY of my old images taken with a Pentax or an Olympus camera. And I am using the latest Rawtherapee just out of the box, on an Intel Mac.
Here’s an example:
P8200051.ORF (14.8 MB)
Set a neutral profile and you see that it does not happen.
I’m assuming, after a quick test, that the Profiled Lens Correction module is the one causing this moire alike pattern. If I turn that one on I see what you posted above.
EDIT: Just tested and this shows up in all RAWs, also NEFs.
I’m assuming this is normal behaviour if you do not do one of the most basic steps (demosaicing).
Well, that’s it. Now that I know that, it seems almost obvious and it makes me look silly.
Thanks, much appreciated.
-P.








