Sony Raw colour cast

Before I begin, I’d like to mention the images below are licensed Creative Commons, By-Attribution, Share-Alike.

So I’ve been having some issues with the colours in my Sony A7ii images lately; and I’ve complained before, but I had settled on the assumption that I am crazy and just too used to the look of my old trusty Nikon D700. I have, however, recently come upon something and I’d really like your input folks. I believe it may just have something to do with the way RawTherapee handles the black points of the channels.

I’ll go over it all in detail, but long story short, I like messing with the RGB channels a lot and having some experience with that it occurred to me that apparently the sony had slightly warm, reddish, blues, especially in the shadow areas, especially compared to the Nikon. The greens also seemed a little blue; but if I warmed the white balance, it would make everything else warmer than needed.

In order to attempt to fix the issue I’ve played with RGB channels, taking red out of blue and blue out of green, but of course it upset the colour balance otherwise.
I then tried employing the colour curves, which I gotta say led me to some nice filmy looking presets, but none that wouldn’t have some obviously unbalanced look to them.
The one that gave really neat results were the black points. I thought I’d try, and when I moved them all the way to the right, it all went black, as expected; however when moving them to the left the image began to brighten but not equally. When i moved them all the way to the left for an expected wall of white …I ended up with magenta!

I tweaked and tweaked and managed to find balances that would cancel out the cast, something along the lines of higher red black point, followed by a slightly lesser blue one, and even lesser green one.

I am wondering: is it possible that perhaps Sony is throwing us some curved ball and we need some different setting in the camera standard? Is my camera messed up? Am I crazy (possibly)?
I’ll throw some samples your way. Conversation is much appreciated!


Here is an image I shot in the woods, in the evening. You may say “okay the ground should not be that red, but maybe it’s just a white balance issue.” The greens, however, seemed fine and I did not need them greener and even more saturated. On second thought, here’s the RAW.

S7_07667.ARW (47.3 MB)


Here you can see me trying to fix the ground and make it look more like muddy dark dirt. It’s not perfect, but sure closer to reality.

I’ll also share a few more in between steps I got here:


So here you can see what it looks like with the black points all the way to the left.
Also can someone explain why in case of the Sony turning the black points all the way to the left gives the image a light coating (which i assume should be white), whereas if I do this on a Nikon file, it does absolutely nothing.


In this screenshot you can see I managed to get the overlay to be more or less neutral with the black points:

Red: -185
Green: -861
Blue: -298

Would love some feedback from you fine folks :slight_smile:
Thanks for reading this far!

@Claes more crazy Sony fun :slight_smile:

I can’t comment on Raw Therapee, but I brought it into darktable, and just used the standard whitebalance-exposure-denoise-filmic-localcontrast pixelpipe. The white balance was a bit off off, so I did a spot white balance off the grey bark on a tree, and the image was under-exposed, so I had to adjust for that too.

Note that in a raw file, it is just a dump of values collected from the sensor, and the interpretation of those value into colour is done inside your raw processor (Raw Therapee, darktable, whatever), and it is not dependent on settings in your camera (ok, ). If you are fiddling with black points, maybe you are ending up with negative values that Raw Therapee is clipping, causing magenta casts and the like? Maybe someone who is more familiar with Raw Therapee can comment on that.

S7_07667.ARW.xmp (7.2 KB)

[Edit: let me just clarify, the camera will make an annotation in the raw file about what white balance settings it would suggest, based on the camera settings at the time. By default, the raw processor will follow this advice, but this is completely up to the raw processor, and it is free to ignore the camera’s suggestion and do the white balancing based on user’s input/spot averaging/etc.)

2 Likes

poor_man_dehaze branch of RT reports this black correction levels for your file:

red : -85
green : -278
blue : -95

having negative values in this range is a clear indicator for wrong blacklevels imho. I will investigate

Note that black level subtraction does not preserve neutral colours, as it happens before wb…

Libraw divines a single black subtraction value of 512 for this image. If I turn that off in rawproc, the resulting image is magenta.

1 Like

As expected, I’d say…

1 Like

RT’s camconst.json from github/dev also reports 512.

1 Like

@stefan.chirila to get to the bottom of this, it may be helpful if you could supply a series of dark frames (lens cap on) for all iso values. Aperture is not important, but make sure your shutter speed is low enough and/or you disabled any form of long exposure noise reduction. In fact, anything that your camera does to the raw and can be turned off, should be.
And now do the same series, but with a longer (> 2s) exposure and LENR on.

I can do some analysis on the files to see what is possibly going on with the black levels.

1 Like

very much appreciated! I shall get to it

any idea why when I did it to the Nikon NEF file giving negative values had no effect at all?

here they are in a ZIP file - no password
http://stefanchirila.com/upload/discussdotpixlsdotus/sony_test/Aug%2026%20Sony%20dark%20frames%20test.zip

AFAIK (older?) Nikon cameras had black levels already subtracted in the NEF, and they also use “white balance pre-conditioning”, i.e. the channels are already scaled somewhat. I think both factors play a role here. However, I don’t really know the details, sorry – if @ilias_giarimis is still around here he should know better.
Edit: possibly also @JackH?

1 Like

@stefan.chirila Thanks for the samples! Some initial findings. I plotted the cumulative fraction of pixels with a certain raw value (without distinction between RGB pixels) for the different ISO’s. Since you provided two series without LENR, I simply averaged them together for slightly better statistics.
This is what you get:


The dashed vertical line marks a black level of 512. The dotted lines are a few values below and above. The dashed horizontal line marks the 0.5 mark. Ideally, and assuming symmetric noise, all curves should have their inflection point at the intersection of both dashed lines.
For all ISO’s this is pretty much the case, at least somewhere in between 511 and 512. The exceptions are ISO 200 and 400, where the inflection point is more between 510 and 511. Not sure why, but I don’t think setting the black level to either 512 or 511 will make a big difference for regular images.

We can also look at the separate RGB channels to see if something is going on there.


I would say that there is also nothing out of the ordinary here. It’s harder to see the actual inflection points here, but at least all intersections with y = 0.5 lie between, either 510-511 or 511-512. You might say that sometimes not all channels behave equally (like for ISO 400 R is a little lower, for ISO 800 B is a little lower and for ISO 1600 G is a little higher), but I think these are all pretty negligible considering this graph is heavily zoomed in.

I haven’t looked at LENR, but at least this little investigation doesn’t seem to indicate anything really wrong with the current black level for all channels on 512.

1 Like

My Nikon D7000 requires no black subtraction. Nikon Z6 requires subtraction of 1008.

If one had the time and inclination, they could download NEFs from DPReview’s comparison collection and grep exiftool output for Black tags, and probably find a Rubicon…

So it seems, also according to, @Thanatomanic that there is, at least from a technical standpoint, nothing wrong with the files? Or did I misunderstand.

I guess at the end of the day, the fact that magenta seems to find its way into shadows, (like the dirt in this image) as well as even blues that are close to mids, sort of bothers me. Also why are the greens so incredibly saturated? I get that perhaps some people would enjoy overly amplified greens, that also tend to lean towards blue on their own; however I’d consider doing that in an edit, not straight out of camera. In my understanding Raws aren’t meant to be this subjective, they are meant to show what the sensor sees :frowning:

@stefan.chirila If the problem is not with the absolute black level, it could still be something else. Maybe there is something going wrong in RawTherapee specifically, because the image @Matt_Maguire produced from darktable seems quite all right to me.

I’m not sure how else we could quantify your magenta cast. Shoot a color target at different exposures and measure deltaE vaues?

2 Likes

As @agriggio mentioned the D700 does dynamic black subtraction before writing data to the raw file, so from then on its BlackLevel is zero and moving the slider to the left would have not effect.

On the other hand on the Sony moving the slider to the left would add an offset to the raw data, effectively reducing the contrast ratio/DR.

1 Like

I would tend to agree that it is a white balance issue on a severely underexposed image I assume combined with a ‘filmic’ curve. The in-camera white balance renders it with an unusually low tint of 0.766 in RT.

Try this: Neutral profile, +4EC, in-camera white balance, tint = 1. The path looks neutral enough to me. For my taste I would lower the color temperature a bit. If you feel that the path was even more neutral than that, white balance off of it with the relative color picker.

I am wondering whether Sony Raw files have the DCP profile for the given setting the camera is on saved/embedded into them.

Here I downloaded someone’s set of dcps for the sony a7ii and the “faithful” setting seems to give me the least amount of grief with greens; making them look closer to what my Nikon would have outputted.