Jump to content

Correcting the green shadows


Guest JonathanP

Recommended Posts

Guest JonathanP

To save clicking on the above links, here's the 6 stop push result:

Welcome, dear visitor! As registered member you'd see an image here…

Simply register for free here – We are always happy to welcome new members!

  • Like 5
Link to post
Share on other sites

Guest JonathanP

So basically my program does 2 steps of processing to a raw file and writes the result out to a new raw file:

 

1. it applies a correction to raw channel data that is approximately an inverse of the gain drop that Jim Kasson measured. This effectively cancels out that non-linearity and removes most of the green shadows.

 

2. a side effect of (1) is that I end up with a small lift in the lowest pixel values. I can then use this little 'headroom' to 'recover' clipped shadows (where the original value was 0), by interpolation from the nearest neighbour pixels. Think of this as very similar to how Lightroom recovers clipped highlights.

 

Now step (1) could be fixed in firmware, because it can be implemented by lookup table and incorporated into the existing image processing pipeline in the camera. Step (2) may be beyond the capabilities of the camera processor but isn't essential as a significant improvement is obtained by step (1) on its own.

 

Jonathan

  • Like 8
Link to post
Share on other sites

Advertisement (gone after registration)

This is great! (BTW, first saw this on Jim's blog) I'd love to see this become broadly available.

 

While I don't often push M240 files that much, there are occasions where it would be very useful... Where I have seen the green shadow cast more frequently is at the ISO 800-1000 range and pushing a file a stop or so. It would seem that as the ISO increases, it takes less push in post to see the green (which makes sense to me).

 

Have you tried your correction at various ISOs and should it work equally well across the board (ISO 200-~800) where the green shadow problem exists?

 

To further what you mentioned, I wonder why Leica chose to push down shadow values like this in the first place? Was it a reaction to the early banding problems seen in preproduction images? From what you've shown, Leica could just as easily 'fix' this problem.

Link to post
Share on other sites

Where can I buy this program? :p

 

Seriously though, this look very impressive and if it really works as well as your images show then it should be put into the firmware of the M240. Although I guess there is a chance that Leica chose this green shadow path to sidestep another problem, and that this green shadow is actually the lesser of two evils.

 

In any event I think many people are very interested in at least having the option of post processing in the way you suggest when dealing with underexposed images.

 

So if either Leica decides to use your insights or if you release your program, I think many of us would be very grateful.

Keep up the great work you're doing and keep us posted.

Link to post
Share on other sites

Guest JonathanP

Ron,

 

I've done all my work so far at ISO 200, but I did do a cursory check on a ISO800 file - saw some improvement but I've not looked properly to see if it needs a different correction table. I suspect from Jim's analysis that it will work but could be improved with ISO specific tables. It would be easy to update the code to do that.

 

I don't know why the M240 has this characteristic - was it by design or just a bug/not of high enough priority? I guess we'll never know, and probably best to avoid another thread here descending into a bug/feature downward spiral ;)

 

The good thing is (made easier by the decision to use DNG rather than a proprietary raw format) that we can make a reasonable effort to fix the problem in post processing. So whilst I'd like Leica to fix the camera, its not the end of the world if they don't. Its clear though that the CMOSIS sensor in the M is being held back a little by the image processing pipeline.

 

Jonathan

  • Like 1
Link to post
Share on other sites

Guest JonathanP

Pieter,

 

My intention is to make the program available free of charge. I was inspired by Jim's detailed analysis which he freely published - it would be wrong to commercialise a development on the back of his work.

 

The only reason I haven't put up a download link at the moment is I'd like a couple of other people to test it first, after all I have only examined files produced by my camera (but based on the results Jim published I am expecting one set of corrections to work well enough with all cameras). If anyone wants to help beta test this for Mac*, please let me know!

 

At present it is Mac only I'm afraid, as I don't have any Windows development tool, but in the long term I wouldn't be adverse to making the source code available for porting to other platforms.

 

Jonathan

 

* its a command line program, but easy to use. Just don't expect any fancy user interface at the moment :)

  • Like 16
Link to post
Share on other sites

  • 2 weeks later...

If you look at some raw histograms, you can see (sort of) what's going on. Many camera manufacturers present their raw data just as it comes off the ADC, with an offset that represents black. The raw developer is then responsible for subtracting the black level. That means that the raw developer can change the level subtracted.

 

Here's a Sony a7S dark frame histogram. It's in speed priority continuous shutter mode, so the 13th and 14 bits are AWOL:

 

spd priority hist.PNG

 

Notice that the average count is about 512, and that we can see in the histogram a classical Gaussian probability density function.

 

In RawDigger, you can see the whole histogram by setting the black level to 0:

 

m240 black level.PNG

 

Now look at an M240 dark frame at 1/4000 second and ISO 1000:

 

m240 hist3.PNG

 

Just about everything is at the lowest bucket.

 

If we go to log scale for the vertical, we can see that there's some information higher than that, but that it's a lot less than half a Gaussian PDF:

 

m240 hist2.PNG

 

If we back way out on the horizontal scale, we can see that the noise actually extends quite high:

 

m240 hist1.PNG

 

 

So the dark levels are truncated in the camera, and they're truncated at a level somewhat above true black. Thus the utility of programs like Mr Perkins'. Congratualtions on a job well done.

 

Jim

  • Like 2
Link to post
Share on other sites

If you look at some raw histograms, you can see (sort of) what's going on. Many camera manufacturers present their raw data just as it comes off the ADC, with an offset that represents black. The raw developer is then responsible for subtracting the black level. That means that the raw developer can change the level subtracted.

Jim

 

Jim, is this something that Leica can or should address with a firmware update?

Is this something that RAW converters like LR etc need to address?

 

I've only had my 240 for about a week and noticed the green shadows almost immediately. IMO this is not a trivial issue.

 

 

Luckily this is something that can be addressed in post, as jperkins has admirably done. But I think we would all would prefer to not have to deal with this issue by preprocessing our images, before working on them in something like Lightroom.

Link to post
Share on other sites

Oh, I can fix it, but frankly this is something Leica should address, especially when you consider the cost of a 240 and Leica claiming that they produce professional cameras of the highest caliber.

Edited by thrid
Link to post
Share on other sites

Jim, is this something that Leica can or should address with a firmware update?

 

I don't know enough about the internal workings of the camera to know if they can address it in firmware. As to whether they should, it depends on the number of people who find it to be a problem. I reported the problem in this forum about 10 months ago:

 

http://www.l-camera-forum.com/leica-forum/leica-m-type-240/298028-leica-m-sensor-low-light-performance-3.html#post2500422

 

and many, if not most, people thought I was making a mountain out of a molehill. If Leica thinks most people don't consider this behavior a problem, they won't be motivated to fix it, assuming that they can.

 

Is this something that RAW converters like LR etc need to address?

 

I don't know about "need to", but the Lr folks have proven to be fairly good at artfully making up data that's beyond fullscale, and maybe they could apply their expertise to data that's below zero. Sloppily said, but you know what i mean, I hope.

 

II've only had my 240 for about a week and noticed the green shadows almost immediately. IMO this is not a trivial issue.

 

Luckily this is something that can be addressed in post, as jperkins has admirably done. But I think we would all would prefer to not have to deal with this issue by preprocessing our images, before working on them in something like Lightroom.

 

You're right. I've chosen to deal with it by using another camera if I"m going to have to push the shadows hard.

 

Jim

Link to post
Share on other sites

Leica needs to hire some color engineers. Perhaps poach some from Canon or Nikon.

 

Maybe so, but this is not actually a color science problem. It's the result of raw data clipping that turns into a color problem since the four raw channels usually receive different shadow exposure.

 

Jim

Link to post
Share on other sites

Guest JonathanP

Thanks Jim for so clearly showing the clipped black issue, which is why I am attempting to recover some red channel information in a very basic way from the neighbouring non-clipped pixels.

 

I think it's important to remember there's two issues here: (1) non-linear gain somewhere in the sensor->ADC->image processing pipeline and (2) loss of information due to black level clipping.

 

I'm finding the non-linearity to be more of a real world picture problem - now I've started processing more of my images I'm noticing a subtle green's problem in landscape images where I often need to lift the shadows slightly after preserving sky highlights. There's a slightly artificial 'digital' look to greens that have been lifted a little - I think it's the early stages of the non-linearity showing up.

 

I would like to see the non-linearity corrected in a firmware update, as I feel it has a noticeable impact and I believe it can be fixed with low-CPU requirements. As you say, raw processors could tackle the black level recovery if they felt there was a demand for it.

 

I do think its a bit of a shame that out of the camera the image quality is not limited by the sensor*, but by the image processing pipeline. It must be a little frustrating for CMOSIS to keep hearing everyone laud the Sony sensors when theirs isn't getting the best exposure.

 

Jonathan

*the non-linearity may of course be in the sensor ADC, but I think it's fair to think of performance as a combination of silicon+software

  • Like 4
Link to post
Share on other sites

I think it's important to remember there's two issues here: (1) non-linear gain somewhere in the sensor->ADC->image processing pipeline and (2) loss of information due to black level clipping.

 

You are right Jonathan.

 

Here's another piece of the puzzle that I discovered yesterday. When I started testing the a7S, I started doing my noise floor measurements in 1/3 stop ISO increments in order to get at when that camera changed conversion gain. I thought I'd take a look at the M240 at 1/3 stop intervals. Here's what I found:

 

http://www.kasson.com/ll/m240 nf vs iso.PNG

 

Notice the kink in the curve? The processing changes between ISO 1000 and ISO 1250. It's even more apparent if you refer the numbers to the input of the pre-ADC amplifier:

 

http://www.kasson.com/ll/m240 nf vs iso corr.PNG

 

Notice that the curve is backwards from most cameras, in which the sensor-referred read noise drops as ISO goes up.

 

I'll be doing a blog post on this with more details some time in the next few days; I'm backed up with the a7S testing.

 

Jim

Edited by JimKasson
  • Like 1
Link to post
Share on other sites

I don't know enough about the internal workings of the camera to know if they can address it in firmware.

 

My guess would be, yes.... at least certain aspects of the problem.

 

 

 

As to whether they should, it depends on the number of people who find it to be a problem. I reported the problem in this forum about 10 months ago:

 

http://www.l-camera-forum.com/leica-forum/leica-m-type-240/298028-leica-m-sensor-low-light-performance-3.html#post2500422

 

and many, if not most, people thought I was making a mountain out of a molehill. If Leica thinks most people don't consider this behavior a problem, they won't be motivated to fix it, assuming that they can.

 

Well, the world is a strange place. We'll get a 20 page debate splitting hairs about the difference between CCD and CMOS or the latest Luigi strap, but green shadows don't seem to be much of an issue.

 

I don't know about "need to", but the Lr folks have proven to be fairly good at artfully making up data that's beyond fullscale, and maybe they could apply their expertise to data that's below zero. Sloppily said, but you know what i mean, I hope.

 

I'm not an engineer, but an 'operator with technical understanding' I get what you are saying. Even if this problem is inherent in the hardware, they should be able to compensate for it with software as Jonathan has demonstrated. Or at least I would think they could

 

 

 

You're right. I've chosen to deal with it by using another camera if I"m going to have to push the shadows hard.

 

Jim

 

hahaha... yes but that kind of defeats the purpose of going from the D600 to a 240....

Edited by thrid
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...