Jump to content

Learning time: What's a Log Gamma? S-Log, C-Log, V-log, Log-C...


Guest Ebrahim Saadawi
 Share

Recommended Posts

Guest Ebrahim Saadawi

I Looked and read on the entire web every single piece of article about it, but without meaning to be rude, all of them fail to understand or describe what it is, just personal information gathered by trying. The only place I could find actual useful data is the manufacturer's technical reports such as the ones from Sony on S-Log and Canon to C-Log PDFs, but they are way too complicated for me, mainly because of two reasons, I am not a native English speaker and, well, doctors are bad at mathematics :rolleyes: 

So an explanation with having these two points in mind would be very appreciated, i.e., without complicated math or language.

I was wondering, what does LOG actually, technically, mean? A logarithmic luminance/chrominance curve right? Isn't it simply raising the shadows and bringing down the highlights with an inversed S-curve applied on the raw data before compression so that you can squeeze more DR into the final file? 

I know there's definitely a variation between the different LOG curve implementations in each brand  (S-log vs C-log vs Log-C vs V-log and so) but that's not what I am asking about I am after the general meaning of a Log gamma in a camera, technically but not in a complex language. 

What about Picture profiles, if one specifies an inverse S curve within the camera settings, a Log one, doesn't that also count technically as a Log gamma? Say like Taking the NX1 cinema profile then taking down all contrast, it's a pretty LOG looking image, with an inverse S curve that shows high shadows and low highs, what about cinestyle in Canon DSLRs? What about Cine-D with Contrast all the way down? Wouldn't these be Log Gammas? (keeping aside how good, effective or bad they perform) 

What constitutes as a Log Gamma?

Link to comment
Share on other sites

EOSHD Pro Color 5 for Sony cameras EOSHD Z LOG for Nikon CamerasEOSHD C-LOG and Film Profiles for All Canon DSLRs

This was an interesting read: http://www.provideocoalition.com/the_not_so_technical_guide_to_s_log_and_log_gamma_curves/page-3

To sum up, S-Log very efficiently puts 12 stops of dynamic range into a five stop bucket by remapping brightness data in a way that makes sense to our eyes, and then throws away the data between the perceptual steps that our eyes can't see. It's a very good form of visually lossless compression.

[..] The idea behind the curves is the same: record only the changes the eye can see and ignore the changes that the eye can't detect.

Link to comment
Share on other sites

Ebrahim. I'm not sure if this will help, but one non-mathematical way to think about encoding log gamma is to imagine just spraying paint against a wall. If the wall is flat, the density of the spray should be even when it dries. If you curve the wall (log) with a knee and shoulder etc and do the same experiment, when the wall is straightened out, the distribution of the paint should have areas that are dense and other areas that are thin. It's the same total amount of info, just re-distributed to encode areas where more detail is needed. For example, setting middle gray at 18% (what we see as 50%) and moving it toward the middle to allow more code values underneath. This was essentially Kodak's scheme to preserve film print density in a low bit depth workflow and digital cameras today are using the same technique, but it was not mean to be the final look of the gamma, the print that was eventually created went back to linear. All the different Log-X types are just variants for different proprietary workflows, but borrowing from Cineon

Link to comment
Share on other sites

sunyata's analogy is quite good. A small correction only: Prints don't have a linear representation of the scene light, not at all. Prints are heavily gamma corrected for projection in dark environments much more so than material meant to be shown on emitting displays. Print-through film curves (that is, scene-to-projection) typically have a gamma in the range 2.5-2.8.

Now first it is important where the "log" comes from. It is because humans perceive exponential light changes as linear changes. This is a logarithmic relationship. Hence, log. Log curves mimic this. Exponential scene light changes are recorded as linear changes. In other words, each increase of exposure with a stop (or doubling the light) takes the same number of coding values to encode, and not double the values of the previous stop (as do linear encodings).

There are a couple of technical benefits:

1) Much more effective and economical utilization of available coding space. This is the reason log curves encode wide dynamic ranges effectively in a smaller bitdepth. Cineon was developed to capture the huge DR of negative film in only 10 bits.

2) (And related to 1) Increased tonal precision in the dark parts of the picture, compared to a physically correct linear encoding (when using the same coding space).

Since sensors work linearly, purely logarithmic curves would waste some coding space in the blacks, because there is not enough density there. That's why practically all log curves are pseudo-log, with some compression in the black end. Arri's Log-C is probably the closest to pure log. Canon's C-log is the furthest away from pure log. The other reason is, as mentioned, mimicking Cineon. This is also, I believe, one of the main reasons all log curves have a raised pure black level. This mimicks the base density (D min) of film, as encoded in the Cineon curve to accommodate scanning film densities.

Link to comment
Share on other sites

Here's my crack at it.  There's a little man in your camera.  He sees everything through the sensor, God like vision :)  However, he is only given 255 paints for each color, red green and blue.   Each color ranges from very dark to very light.  He uses this combination of 255 x 255 x 255 reds, greens, and blues, to create a full color image for you.  The problem for our little camera-man is that he often sees colors, say a blue, that sit between two of his blue paints.  Might be a 243.5, a little brighter than 243 and a little darker than 244.  Indeed, he believes he really needs 1,000 paints per color to render a good image.  

But, and this is the first KEY thing, HE ONLY HAS 255 PAINTS TO WORK WITH IN EACH COLOR.  

You go to the beach with your camera and you take an image of your wife.  The man in your camera says, it's a shame I don't have more lighter colors because there's a fantastic twinkle in your wife's eyes and nice colors in those clouds.  I have all these dark colors and I don't need any of them.  

So what if you found a way to take his palette of 255 colors, throw out half of the dark colors and give him double the amount of light colors?  So you have, say 1,3,5,7 at the low end and then, 225, 225.5, 226, 226.6 at the high end?  What if you did that, but spread it out evenly (Curved them); that is, gave him only a few paints for dark colors but more and more colors as you got lighter--KEEPING IN MIND YOU HAVE A MAXIMUM of 255?

You DO NOT END UP WITH MORE RECORDED DYNAMIC RANGE.  Rather, you have REDUCED dynamic range where you AESTHETICALLY don't care about it, and INCREASED dynamic range where you do.  But it is a judgment call.  The total dynamic range is still 255 colors.

I got into a lot of trouble with these logs on the GH4 because I don't have enough experience to know when it's better to shift the recorded dynamic range.  I'd rather have RAW because you can apply curves AFTER the fact.  If you shoot S-LOG in an evenly lit scene you'll end up with muddy darks because you didn't give them the same paints as you gave the lights.

Hope this helps!

 

Link to comment
Share on other sites

sunyata's analogy is quite good. A small correction only: Prints don't have a linear representation of the scene light, not at all.

Thanks and yes, I wasn't referring to the print gamma profile, I meant film (the substance), sorry if that wasn't clear. In particular I think it's good to get out there that Log is part of a DI workflow (assuming low bit depth) and not the look of film or the film stocks that people still use as a reference.

Also agree with Maxotics point, it's good to point out that you aren't encoding more total data, just shuffling around what you want to preserve.

Link to comment
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.   Restore formatting

  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.

 Share

  • EOSHD Pro Color 5 for All Sony cameras
    EOSHD C-LOG and Film Profiles for All Canon DSLRs
    EOSHD Dynamic Range Enhancer for H.264/H.265
×
×
  • Create New...