13
\$\begingroup\$

On the photos where the lens flare is present, my Nikon D7000 is drawing strange labyrinth-looking artifacts. Here's an example.

The first image is a screenshot of a little part of the original photo zoomed 2:1 in Lightroom.

The second image is the same photo with Lightroom's contrast, clarity and sharpening set to the maximum to make the labyrinth pattern more visible.

enter image description here

enter image description here

This affects only some of the photos presenting lens flare. Here, for instance, the lens flare is present and light conditions are very close to the first photo, but there is no labyrinth pattern, only usual noise (screenshot of a part of a photo at 1:1 with contrast, clarity and sharpening set to the maximum):

enter image description here

Notes:

  • I can see this pattern only on some of the photos when the sun is in the frame or nearly in the frame.

  • It is present with any lens I tested.

  • The actual photo was shot at f/8, ISO 200, 1/640 s. I've seen this pattern in photos shot at ISO 100 as well.

  • The photo is in RAW format, so this is not a JPEG artifact.

What is that? How do I avoid it?

\$\endgroup\$
4
  • 4
    \$\begingroup\$ The nature of the artifacts makes me think it's happening at the demosaicing step, but there's nothing unusual about the D7000's color filter array that would prompt anything like that. I don't suppose you could provide a sample RAW? \$\endgroup\$
    – hobbs
    Commented Oct 24, 2017 at 0:03
  • 3
    \$\begingroup\$ I have to say that if you're looking at this level of zoom at an image and searching for problems you will find them. And you then exaggerate them by e.g. sharpening. But do you actually see these things in a print ? Do they really matter or are you just making your own life more difficult worrying about them ? What you're doing would be like taking a microscope to examine a film negative and complaining about grain being visible. \$\endgroup\$ Commented Oct 24, 2017 at 2:58
  • 2
    \$\begingroup\$ @hobbs: here's a sample RAW: drive.google.com/file/d/0B3keqY_6PUhwTjRJSXJYdU1UQUE/…. It is not that exact picture I posted in my question (since I deleted the RAW since then), but the one taken a few seconds later and which presents the exact same pattern. \$\endgroup\$ Commented Oct 24, 2017 at 19:23
  • 3
    \$\begingroup\$ @StephenG: I never said I was worrying about those patterns. I am just curious about their origin, given their unusual shape; luckily, I asked the question and learned something new from the great answers. \$\endgroup\$ Commented Oct 24, 2017 at 19:25

3 Answers 3

8
\$\begingroup\$

Anything you are viewing on the screen is not raw data. Raw image data are linear monochrome luminance values and nothing else. Anything that shows more than one color is the result of the application you are using to view the image translating the raw luminance values into gamma corrected light curves and demosaicing applied to create interpolated colors and reducing it to 8-bits to be sent to your 8-bit monitor.

If you view the same raw data using an application that uses different demosaicing and gamma correction algorithms you will see different patterns which may be more or less regular than those you got with whatever application you were using to view them above.

The patterns you see in the first image are also present in the second. They're just not as widespread or as uniform. Look carefully at the transition area between the very light and very dark area near the upper left. They're there. Your first image just has much more area where there are medium tonal values that are all the same hue and are being pushed up (brighter pixels) or down (the darker pixels) by the processing algorithm.

4X crop
A 4x magnified crop of your second image

8X crop
An 8X magnified crop of an area near the top center of the above crop. Notice the 'stairstep' patterns along the diagonal area of contrast?

When you increase contrast you make the light response curve steeper and minor differences in brightness in the midtones are amplified. In effect you are forcing all pixels to be very dark or very light with not much in between.

It's just a guess, but my hunch is the dark lines in the first image are those pixels most influenced by blue filtered pixels and the lighter lines are those pixels most influenced by red and green filtered pixels. Keep in mind that all three color values for each pixel are usually interpolated during demosaicing. This is because some of the entire visible spectrum gets through all three different colored filters of a Bayer mask.¹ Some of the green filtered pixels between two blue colored pixels are being pulled darker. Most of the green pixels are being pulled with the reds towards lighter. That would explain why the lighter colored lines are usually two pixels wide and the darker lines are single pixel width.

When almost all of the light in a given area is near the same color (in terms of chroma) the only thing the demosaicing algorithm has to differentiate one pixel from the next is brightness. The veiling flare caused by the sun makes the brightness from one pixel to the next more uniform than would otherwise be the case. This might explain the phenomenon of longer straight lines of darker and lighter pixels rather than a more random distribution as seen on most of the second photo.

¹ Not only that, but also because the "red", "green", and "blue" filters we use in our Bayer masks are not the same colors as the 'Red', 'Green', and 'Blue' colors emitted by our RGB displays. Red, in particular, is nowhere near the same. Our Bayer masks tend to be centered on about 590-600nm (an orange-yellow color) that is closer to what our retinas' "red" L-cones are most sensitive to (around 565nm that is a yellow-lime-green color) than the 640-645nm our displays emit for the red channel.

\$\endgroup\$
3
  • \$\begingroup\$ "Raw image data are linear monochrome luminance values and nothing else." How are eg interpretations that map raw RGGB directly to screen RGB (discarding one green channel, obviously only showing a 1:1 part of the image, discarding LSB) not a display of raw data? \$\endgroup\$ Commented Nov 27, 2020 at 11:47
  • \$\begingroup\$ The filters on a Bayer mask are far from most transmissive of the same colors emitted by each channel of RGB display technology, not to even mention CYMK subtractive systems. Each filter also allows photons from a much wider range of wavelengths through than is emitted by even the lowest quality RGB devices. So while one can assign a particular color to a monochrome value, it's not a remotely accurate one in the same way that printing a monochrome photo on blue paper doesn't accurately represent even the blue objects that were photographed, much less the yellow, green, magenta,etc. ones. \$\endgroup\$
    – Michael C
    Commented Nov 27, 2020 at 18:10
  • \$\begingroup\$ Of course, but why would one do it anyway if not for either analysis or artistic purposes, rather than accuracy or fidelity? \$\endgroup\$ Commented Nov 27, 2020 at 18:41
8
\$\begingroup\$

The maze artifacts are from the demosaicing alrgorithm.

See http://www.ruevski.com/rawhistogram/40D_Demosaicing/40D_DemosaicingArtifacts.html

And the discussion of DCB here: https://rawpedia.rawtherapee.com/Demosaicing

Related What are the pros and cons of different Bayer demosaicing algorithms?

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Good catch, that "green channel crosstalk" issue looks exactly like it. My understanding is that (due to vagaries of sensor design) half of the green pixels end up more strongly correlated with red, and half end up more strongly correlated with blue, and when it all shakes out, some algorithms interpret that as high-frequency luma content, more or less. \$\endgroup\$
    – hobbs
    Commented Oct 24, 2017 at 18:10
  • \$\begingroup\$ This is exactly why I asked for a raw — I was hoping to run OP's image through a few alternative algorithms :) \$\endgroup\$
    – hobbs
    Commented Oct 24, 2017 at 18:11
8
\$\begingroup\$

To confirm ben rudgers' analysis, I took the NEF file you supplied and ran it through RawTherapee.

Here's an enlargement of a similar crop with no adjustments and the default "amaze" demosaicing algorithm:

amaze

Here's the same with "DCB" algorithm:

dcb

And here's the same with the "VNG4" algorithm, which is known to be resistant to green-crosstalk, but a little less sharp overall:

VNG4

The problem area is pretty much ideal for bringing out this issue: the values in the red and blue channels are very different (blue is nearly zero, red is similar to green), there are patches of low detail (the artifacts are more apparent without actual detail covering them up), and this part of the photo is near a corner, where the light is reaching the sensor at a lower angle, making the crosstalk more likely to occur.

I tried to make another image using the "none" demosaicing mode, to illustrate the difference in value between green pixels surrounded by red ones, and green pixels surrounded by blue, but couldn't quite manage it :)

\$\endgroup\$
1
  • \$\begingroup\$ RT also has a "Green Equilibration" slider that can reduce maze artifacts with any demosaicing algo. \$\endgroup\$
    – Cobra_Fast
    Commented Feb 24, 2022 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.