Gamma Encoding – Under the Hood

Gamma, Gamma Encoding & Decoding

Gamma – now there’s a term I see cause so much confusion and misunderstanding.

So many people use the term without knowing what it means.

Others get gamma mixed up with contrast, which is the worst mistake anyone could ever make!

Contrast controls the spatial relationship between black and white; in other words the number of grey tones.  Higher contrast spreads black into the darker mid tones and white into the upper mid tones.  In other words, both the black point and white point are moved.

The only tones that are not effected by changes in image gamma are the black point and white point – that’s why getting gamma mixed up with contrast is the mark of a “complete idiot” who should be taken outside and summarily shot before they have chance to propagate this shocking level of misunderstanding!

What is Gamma?

Any device that records an image does so with a gamma value.

Any device which displays/reproduces said image does so with a gamma value.

We can think of gamma as the proportional distribution of tones recorded by, or displayed on, a particular device.

Because different devices have different gamma values problems would arise were we to display an image that has a gamma of X on a display with a gamma of Y:

Ever wondered what a RAW file would look like displayed on a monitor without any fancy colour & gamma managed software such as LR or ACR?

Rawdump 900x299 Gamma Encoding   Under the Hood

A raw file displayed on the back of the camera (left) and as it would look on a computer monitor calibrated to a gamma of 2.2 & without any colour & gamma management (right).

The right hand image looks so dark because it has a native gamma of 1.0 but is being displayed on a monitor with a native gamma of 2.2

RAW file Gamma

To all intents and purposes ALL RAW files have a gamma of 1.0

CamGam 900x705 Gamma Encoding   Under the Hood

Camera Sensor/Linear Gamma (Gamma 1.0)

Digital camera sensors work in a linear fashion:

If we have “X” number of photons striking a sensor photosite then “Y” amount of electrons will be generated.

Double the number of photons by doubling the amount of light, then 2x “Y” electrons will be generated.

Halve the number of photons by reducing the light on the scene by 50% then 0.5x “Y” electrons will be generated.

We have two axes on the graph; the horizontal x axis represents the actual light values in the scene, and the vertical y axis represents the output or recorded tones in the image.

So, if we apply Lab L* values to our graph axes above, then 0 equates to black and 1.0 equates to white.

The “slope” of the graph is a straight line giving us an equal relationship between values for input and output.

It’s this relationship between input and output values in digital imaging that helps define GAMMA.

In our particular case here, we have a linear relationship between input and output values and so we have LINEAR GAMMA, otherwise known as gamma 1.0.

Now let’s look at a black to white graduation in gamma 1.0 in comparison to one in what’s called an encoding gamma:

LinVsHum31 900x272 Gamma Encoding   Under the Hood

Linear (top) vs Encoded Gamma

The upper gradient is basically the way our digital cameras see and record a scene.

There is an awful lot of information about highlights and yet the darker tones and ‘shadow’ areas are seemingly squashed up together on the left side of the gradient.

Human vision does not see things in the same way that a camera sensor does; we do not see linearly.

If the amount of ambient light falling on a scene suddenly doubles we will perceive the increase as an unquantifiable “it’s got brighter”; whereas our sensors response will be exactly double and very quantifiable.

Our eyes see a far more ‘perceptually even’ tonal distribution with much greater tonal separation in the darker tones and a more compressed distribution of highlights.

In other words we see a tonal distribution more like that contained in the gamma encoded gradient.

Gamma encoding can be best illustrated with another graph:

EyeGam 5 900x705 Gamma Encoding   Under the Hood

Linear Gamma vs Gamma Encoding 1/2.2 (0.4545)

Now sadly this is where things often get misunderstood, and why you need to be careful about where you get information from.

The cyan curve is NOT gamma 2.2 – we’ll get to that shortly.

Think of the graph above as the curves panel in Lightroom, ACR or Photoshop – after all, that’s exactly what it is.

Think of our dark, low contrast linear gamma image as displayed on a monitor – what would we need to do to the linear slope  to improve contrast and generally brighten the image?

We’d bend the linear slope to something like the cyan curve.

The cyan curve is the encoding gamma 1/2.2.

There’s a direct numerical relationship between the two gamma curves; linear and 1/2.2. and it’s a simple power law:

  •  VO = VIγ where VO = output value, VI = input value and γ = gamma

Any input value (VI) on the linear gamma curve to the power of γ equals the output value of the cyan encoding curve; and γ as it works out equals 0.4545

  •  VI 0 = VO 0
  •  VI 0.25 = VO 0.532
  •  VI 0.50 = VO 0.729
  •  VI 0.75 = VO 0.878
  •  VI 1.0 = VO 1.0

Now isn’t that bit of maths sexy………………..yeah!

Basically the gamma encoding process remaps all the tones in the image and redistributes them in a non-linear ratio which is more familiar to our eye.

Note: the gamma of human vision is not really gamma 1/2.2 – gamma 0.4545.  It would be near impossible to actually quantify gamma for our eye due to the behavior of the iris etc, but to all intents and purposes modern photographic principles regard it as being ‘similar to’..

So the story so far equates to this:

GammaEncode1 900x749 Gamma Encoding   Under the Hood

Gamma encoding redistributes tones in a non-linear manner.

But things are never quite so straight forward are they…?

Firstly, if gamma < 1 (less than 1) the encoding curve goes upwards – as does the cyan curve in the graph above.

But if gamma > 1 (greater than 1) the curve goes downwards.

A calibrated monitor has (or should have) a calibrated device gamma of 2.2:

EyeGam7 900x705 Gamma Encoding   Under the Hood

Linear, Encoding & Monitor gamma curves.

As you can now see, the monitor device gamma of 2.2 is the opposite of the encoding gamma – after all, the latter is the reciprocal of the former.

So what happens when we apply the decoding gamma/monitor gamma of 2.2 to our gamma encoded image?

EyeGam8 900x705 Gamma Encoding   Under the Hood

The net effect of Encode & Decode gamma – Linear.

That’s right, we end up back where we started!

Now, are you thinking:

  • Don’t understand?
  • We are back with our super dark image again?

Welcome to the worlds biggest Bear-Trap!

The “Learning Gamma Bear Trap”

Hands up those who are thinking this is what happens:

beartrap 900x445 Gamma Encoding   Under the Hood

If your arm so much as twitched then you are not alone!

I’ll admit to being naughty and leading you to edge of the pit containing the bear trap – but I didn’t push you!

While you’ve been reading this post have you noticed the occasional random bold and underlined text?

Them’s clues folks!

The super dark images – both seascape and the rope coil – are all “GAMMA 1.0 displayed on a GAMMA 2.2 device without any management”.

That doesn’t mean a gamma 1.0 RAW file actually LOOKS like that in it’s own gamma environment!

That’s the bear trap!

GammaFlow 2 900x402 Gamma Encoding   Under the Hood

Gamma 1.0 to gamma 2.2 encoding and decoding

Our RAW file actually looks quite normal in its own gamma environment (2nd from left) – but look at the histogram and how all those darker mid tones and shadows are piled up to the left.

Gamma encoding to 1/2.2 (gamma 0.4545) redistributes and remaps those all the tones and lightens the image by pushing the curve up BUT leaves the black and white points where they are.  No tones have been added or taken away, the operation just redistributes what’s already there.  Check out the histogram.

Then the gamma decode operation takes place and we end up with the image on the right – looks perfect and ready for processing, but notice the histogram, we keep the encoding redistribution of tones.

So, are we back where we started?  No.

Luckily for us gamma encoding and decoding is all fully automatic within a colour managed work flow and RAW handlers such as Lightroom, ACR and CapOnePro etc.

Image gamma changes are required when an image is moved from one RGB colour space to another:

  • ProPhoto RGB has a gamma of 1.8
  • Adobe RGB 1998 has a gamma of 2.2
  • sRGB has an oddball gamma that equates to an average of 2.2 but is nearly 1.8 in the deep shadow tones.
  • Lightrooms working colour space is ProPhoto linear, in other words gamma 1.0
  • Lightrooms viewing space is MelissaRGB which equates to Prophoto with an sRGB gamma.

Image gamma changes need to occur when images are sent to a desktop printer – the encode/decode characteristics are actually part and parcel of the printer profile information.

Gamma awareness should be exercised when it comes to monitors:

  • Most plug & play monitors are set to far too high a gamma ‘out the box’ – get it calibrated properly ASAP; it’s not just about colour accuracy.
  • Laptop screen gamma changes with viewing position – God they are awful!

Anyway, that just about wraps up this brief explanation of gamma; believe me it is brief and somewhat simplified – but hopefully you get the picture!

 

Please consider supporting this blog.

This blog really does need your support. All the information I put on these pages I do freely, but it does involve costs in both time and money.

If you find this post useful and informative please could you help by making a small donation – it would really help me out a lot – whatever you can afford would be gratefully received.

Your donation will help offset the costs of running this blog and so help me to bring you lots more useful and informative content.

Many thanks in advance.

 

Lightroom Training – The Library Module

Lightroom training – the Lightroom 5 Library Module.

Screen Shot 2014 01 21 at 14.52.43 copy Lightroom Training   The Library Module

A SHAMELESS plug I know – but I’ve got to eat you know!

 

I’ve just finished my latest training title on Lightroom 5 all about “The Library Module”.

The sad thing is that most Lightroom users think of the library module as BORING because they just want to ‘get in there’ and start wanging sliders around in the Develop Module.

 

And guess what – even I find it tedious!

 

But mastery of the Library Module in Lightroom 5 will make the more captivating parts of Lightroom a far more enjoyable experience, both in terms of productivity, speed and efficiency.

 

This training title is NOT a total ‘drill-down’ into the minutia of every detail – now that WOULD be boring!

But I’ve ‘cherry-picked’ everything that I feel the average Lightroom user needs to know and understand in order to get the best from their general Lightroom experience.

 

Most of the topics are covered in multiple lessons and include:

  • Finding your way around the Lightroom GUI
  • The Lightroom Catalog – file location
  • Catalog Backup
  • Merging Catalogs
  • Creating New Catalogs from existing ones
  • Migrating catalogs from one hard drive to another
  • Library Module Previews – there’s far more to previews than you think!
  • Smart Previews
  • 1 to 1 previews
  • Metadata Attributes
  • Saving Metadata to XMP (saving metadata to the RAW file)
  • Saved Metadata Conflicts & Update Warnings
  • Collections
  • Smart Collections
  • Quick & Target Collections
  • Spray Can
  • Cell & Thumbnail Iconography
  • Key Wording & IPTC Data
  • The Searchable Image database
  • Camera Profiles & Import presets

 

37 videos – approx: 235 minutes running time.

 

Ever wondered what all those funny little icons on your thumbnails – especially the scary looking ones in the top right corner of cells mean?  Wonder no more!

Is your computer running slowly because your Lightroom catalog is in the wrong place?

Can’t find your images in the Lightroom catalog?

My Lightroom training videos will show you how to avoid these and many other problems.

 

Learn how to setup Lightroom so this it causes minimum impact on your computer system, and speeds your way through to the more interesting bits!

 

And these Lightroom training video lessons are all iPad3/4 compliant so you can load them directly to your iPad via iTunes without converting them first.

 

Available for instant download from my new store – HERE

New Download Store Open

 

Screen Shot 2014 01 24 at 17.51.47 New Download Store Open

Wildlife in Pixels Digital Download Store

 

By popular demand I’m now pleased to announce the launch of my Digital Download Store – now you can purchase and download my training videos directly to your computer.

No more ‘messing about’ with DVDs or waiting for post!

 

All video lessons are Quicktime H.264 & 1600 pixels long edge, and where applicable come complete with exercise files, so you can “work along with Andy”; but please be aware that the exercise files folders are sometimes quite large (400Mb+ in some cases) and so will take a while to download.

 

As always, my aim is to bring you top quality training in Lightroom & Photoshop with a bias towards effectiveness and time-saving as well as making your images look their very best.

 

The store is located HERE

 

I hope you enjoy!

 

 

 

Photoshop CC Update

Photoshop CC Update

Installing a new Photoshop CC update is supposed to be a simple matter of clicking a button and the job gets done.

This morning both my Mac systems were telling me to update from v14.1.2 to v14.2

I have two Macs, a late 2012 iMac and a mid 2009 Mac Pro.  The Mac Pro used to run Snow Leopard but was upgraded to Mountain Lion because of Lightroom 5 dropping Snow Leopard support.

Now I never have any problems with Cloud Updates from Adobe on the iMac, but sometimes the Mac Pro can do some strange things – and this morning was no exception!

The update installed on the iMac without a hitch, but when the update was complete on the Mac Pro I was greeted with a message telling me that some components had not installed correctly.  On opening Photoshop CC I was greeted with the fact that the version had rolled back to v14.0 and that hitting UPDATE in both the app and my CC control panel simply informed me that my software was up to date and no updates were available!

So I just thought I’d do a blog entry on what to do if this ever happens to you!

 

Remove Photoshop CC

The first thing to do is UNINSTALL  Photoshop CC with the supplied uninstaller.

You’ll find this in the main Photoshop CC root directory:

Screen Shot 2014 01 16 at 11.43.46 900x460 Photoshop CC Update

Locate the Photoshop CC Uninstaller.

Take my advice and put a tick in the check box to “Remove Preferences” – the Photoshop preferences file can be a royal pain in the ass sometimes, so dump it – a new one will get written as soon as your fire Photoshop up after the new install.

Click UNINSTALL.

Once this action is complete YOU MUST RESTART THE MACHINE.

 

After the restart wait for the Creative Cloud to connect then open your CC control panel.

Under the Apps tab you’ll see that Photoshop CC is no longer listed.

Scroll down past all the apps Adobe have listed and you’ll come to Photoshop CC;  it’ll have an INSTALL button next to it – click the install button:

Screen Shot 2014 01 16 at 11.12.07 Photoshop CC Update

Install Photoshop CC from the Cloud control panel.

If you are installing the 14.1.2 to 14.2 update (the current one as of today’s date) you might find a couple of long ‘stick bits’ during the installation process – notably between 1 and 20% and a long one at 90% – just let the machine do it’s thing.

When the update is complete I’d recommend you do a restart – it might not be necessary, but I do it anyway.

Once the machine has restarted fire up Photoshop, click on ‘About Photoshop’ and you should see:

Screen Shot 2014 01 16 at 11.19.10 Photoshop CC Update

Photoshop “about screen” showing version number.

Because we dumped the preferences file we need to go and change the defaults for best best working practice:

Screen Shot 2014 01 16 at 12.15.00 900x605 Photoshop CC Update

Preferences Interface tab.

If you want to change the BG colour then do it here.

Next, click File Handling:

Screen Shot 2014 01 16 at 12.13.43 900x608 Photoshop CC Update

File handling tab in Photoshop Preferences

Remove the tick from the SAVE IN BACKGROUND check box – like the person who put it there, you too might think background auto-save is a good idea – IT ISN’T – think about it!

Finally, go to Performance:

Screen Shot 2014 01 16 at 12.14.33 900x600 Photoshop CC Update

Photoshop preferences Performance tab

and change the Scratch Disc to somewhere other than your system drive if you have the internal drives fitted.  If you only have 1 internal drive then leave “as is”.  You ‘could’ use an external drive as a scratch disk, but to be honest it really does need to be a fast drive over a fast connection – USB 2 to an old 250Gb portable isn’t really going to cut it!

You can go and check your Colour Settings, though these should not have changed – assuming you had ’em set right in the first place!

Here’s what they SHOULD look like:

Screen Shot 2013 11 18 at 13.47.30 Photoshop CC Update

Photoshop PROPER COLOUR SETTINGS!

That’s it – you’re done!

 

Please consider supporting this blog.

This blog really does need your support. All the information I put on these pages I do freely, but it does involve costs in both time and money.

If you find this post useful and informative please could you help by making a small donation – it would really help me out a lot – whatever you can afford would be gratefully received.

Your donation will help offset the costs of running this blog and so help me to bring you lots more useful and informative content.

Many thanks in advance.

 

Accurate Camera Colour within Lightroom

Obtaining accurate camera colour within Lightroom 5, in other words making the pics in your Lr Library look like they did on the back of the camera; is a problem that I’m asked about more and more since the advent of Lightroom 5 AND the latest camera marks – especially Nikon!

UPDATE NOTE: Please feel free to read this post THEN go HERE for a further post on achieving image NEUTRALITY in Lightroom 6/CC 2015

Does this problem look familiar?

Screen Shot 2014 01 14 at 08.05.24 900x303 Accurate Camera Colour within Lightroom

Back of the camera (left) to Lightroom (right) – click to enlarge.

The image looks fine (left) on the back of the camera, fine in the import dialogue box, and fine in the library module grid view UNTIL the previews have been created – then it looks like the image on the right.

I hear complaints that the colours are too saturated and the contrast has gone through the roof, the exposure has gone down etc etc.

All the visual descriptions are correct, but what’s responsible for the changes is mostly down to a shift in contrast.

Let’s have a closer look at the problem:

2 900x483 Accurate Camera Colour within Lightroom

Back of the camera (left) to Lightroom (right) – click to enlarge.

The increase in contrast has resulted in “choking” of the shadow detail under the wing of the Red Kite, loss of tonal separation in the darker mid tones, and a slight increase in the apparent luminance noise level – especially in that out-of-focus blue sky.

And of course, the other big side effect is an apparent increase in saturation.

You should all be aware of my saying that “Contrast Be Thine Enemy” by now – and so we’re hardly getting off to a good start with a situation like this are we…………

So how do we go about obtaining accurate camera colour within Lightroom?

Firstly, we need to understand just what’s going on inside the camera with regard to various settings, and what happens to those settings when we import the image into Lightroom.

Camera Settings & RAW files

Let’s consider all the various settings with regard to image control that we have in our cameras:

  • White Balance
  • Active D lighting
  • Picture Control – scene settings, sharpening etc:
  • Colour Space
  • Distortion Control
  • Vignette Control
  • High ISO NR
  • Focus Point/Group
  • Uncle Tom Cobbly & all…………..

All these are brought to bare to give us the post-view jpeg on the back of the camera.

And let’s not forget

  • Exif
  • IPTC

That post-view/review jpeg IS subjected to all the above image control settings, and is embedded in the RAW file; and the image control settings are recorded in what is called the raw file “header”.

It’s actually a lot more complex than that, with IFD & MakerNote tags and other “scrummy” tech stuff – see this ‘interesting’ article HERE – but don’t fall asleep!

If we ship the raw file to our camera manufacturers RAW file handler software such as Nikon CapNX then the embedded jpeg and the raw header data form the image preview.

However, to equip Lightroom with the ability to read headers from every digital camera on the planet would be physically impossible, and in my opinion, totally undesirable as it’s a far better raw handler than any proprietary offering from Nikon or Canon et al.

So, in a nutshell, Lightroom – and ACR – bin the embedded jpeg preview and ignore the raw file header, with the exception of white balance, together with Exif & IPTC data.

However, we still need to value the post jpeg on the camera because we use it to decide many things about exposure, DoF, focus point etc – so the impact of the various camera image settings upon that image have to be assessed.

Now here’s the thing about image control settings “in camera”.

For the most part they increase contrast, saturation and vibrancy – and as a consequence can DECREASE apparent DYNAMIC RANGE.  Now I’d rather have total control over the look and feel of my image rather than hand that control over to some poxy bit of cheap post-ASIC circuitry inside my camera.

So my recommendations are always the same – all in-camera ‘picture control’ type settings should be turned OFF; and those that can’t be turned off are set to LOW or NEUTRAL as applicable.

That way, when I view the post jpeg on the back of the camera I’m viewing the very best rendition possible of what the sensor has captured.

And it’s pointless having it any other way because when you’re shooting RAW then both Lightroom and Photoshop ACR ignore them anyway!

Accurate Camera Colour within Lightroom

So how do we obtain accurate camera colour within Lightroom?

We can begin to understand how to achieve accurate camera colour within Lightroom if we look at what happens when we import a raw file; and it’s really simple.

Lightroom needs to be “told” how to interpret the data in the raw file in order to render a viewable preview – let’s not forget folks, a raw file is NOT a visible image, just a matrix full of numbers.

In order to do this seemingly simple job Lightroom uses process version and camera calibration settings that ship inside it, telling it how to do the “initial process” of the image – if you like, it’s a default process setting.

And what do you think the default camera calibration setting is?

3 copy 900x577 Accurate Camera Colour within Lightroom

The ‘contrasty’ result of the Lightroom Nikon D4 Adobe Standard camera profile.

Lightroom defaults to this displayed nomenclature “Adobe Standard” camera profile irrespective of what camera make and model the raw file is recorded by.

Importantly – you need to bare in mind that this ‘standard’ profile is camera-specific in its effect, even though the displayed name is the same when handling say D800E NEF files as it is when handling 1DX CR2 files, the background functionality is totally different and specific to the make and model of camera.

What it says on the tin is NOT what’s inside – so to speak!

So this “Adobe Standard” has as many differing effects on the overall image look as there are cameras that Lightroom supports – is it ever likely that some of them are a bit crap??!!

Some files, such as the Nikon D800 and Canon 5D3 raws seem to suffer very little if any change – in my experience at any rate – but as a D4 shooter this ‘glitch in the system’ drives me nuts.

But the walk-around is so damned easy it’s not worth stressing about:

  1. Bring said image into Lightroom (as above).
  2. Move the image to the DEVELOP module
  3. Go to the bottom settings panel – Camera Calibration.
  4. Select “Camera Neutral” from the drop-down menu:
    4 900x577 Accurate Camera Colour within Lightroom

    Change camera profile from ‘Adobe Standard’ to ‘Camera Neutral’ – see the difference!

    You can see that I’ve added a -25 contrast adjustment in the basics panel here too – you might not want to do that*

  5. Scoot over to the source panel side of the Lightroom GUI and open up the Presets Panel

    5 copy 900x531 Accurate Camera Colour within Lightroom

    Open Presets Panel (indicated) and click the + sign to create a new preset.

  6. Give the new preset a name, and then check the Process Version and Calibration options (because of the -25 contrast adjustment I’ve added here the Contrast option is ticked).
  7. Click CREATE and the new “camera profile preset” will be stored in the USER PRESETS across ALL your Lightroom 5 catalogs.
  8. The next time you import RAW files you can ADD this preset as a DEVELOP SETTING in the import dialogue box:
    6 Accurate Camera Colour within Lightroom

    Choose new preset

    7 Accurate Camera Colour within Lightroom

    Begin the import

  9. Your images will now look like they did on the back of the camera (if you adopt my approach to camera settings at least!).

You can play around with this procedure as much as you like – I have quite a few presets for this “initial process” depending on a number of variables such as light quality and ISO used to name but two criteria (as you can see in the first image at 8. above).

The big thing I need you to understand is that the camera profile in the Camera Calibration panel of Lightroom acts merely as Lightroom’s own internal guide to the initial process settings it needs to apply to the raw file when generating it’s library module previews.

There’s nothing complicated, mysterious or sinister going on, and no changes are being made to your raw images – there’s nothing to change.

In fact, I don’t even bother switching to Camera Neutral half the time; I just do a rough initial process in the Develop module to negate the contrast in the image, and perhaps noise if I’ve been cranking the ISO a bit – then save that out as a preset.

Then again, there are occasions when I find switching to Camera Neutral is all that’s needed –  shooting low ISO wide angle landscapes when I’m using the full extent of the sensors dynamic range springs to mind.

But at least now you’ve got shots within your Lightroom library that look like they did on the back of the camera, and you haven’t got to start undoing the mess it’s made on import before you get on with the proper task at hand – processing – and keeping that contrast under control.

Some twat on a forum somewhere slagged this post off the other day saying that I was misleading folk into thinking that the shot on the back of the camera was “neutral” – WHAT A PRICK…………

All we are trying to do here is to make the image previews in Lr5 look like they did on the back of the camera – after all, it is this BACK OF CAMERA image that made us happy with the shot in the first place.

And by ‘neutralising’ the in-camera sharpening and colour/contrast picture control ramping the crappy ‘in camera’ jpeg is the best rendition we have of what the sensor saw while the shutter was open.

Yes, we are going to process the image and make it look even better, so our Lr5 preview starting point is somewhat irrelevant in the long run; but a lot of folk freak-out because Lr5 can make some really bad changes to the look of their images before they start.  All we are doing in this article is stopping Lr5 from making those unwanted changes.

Help Me to Help You!

 

Please consider supporting this blog.

This blog really does need your support. All the information I put on these pages I do freely, but it does involve costs in both time and money.

If you find this post useful and informative please could you help by making a small donation – it would really help me out a lot – whatever you can afford would be gratefully received.

Your donation will help offset the costs of running this blog and so help me to bring you lots more useful and informative content.

Many thanks in advance.

 

MTF, Lens & Sensor Resolution

MTF, Lens & Sensor Resolution

I’ve been ‘banging on’ about resolution lens performance and MTF over the last few posts so I’d like to start bringing all these various bits of information together with at least a modicum of simplicity.

If this is your first visit to my blog I strongly recommend you peruse HERE and HERE before going any further!

You might well ask the question “Do I really need to know this stuff – you’re a pro Andy and I’m not, so I don’t think I need to…”

My answer is “Yes you bloody well do need to know, so stop whinging – it’ll save you time and perhaps stop you wasting money…”

Words used like ‘resolution’ do tend to get used out of context sometimes, and when you guys ‘n gals are learning this stuff then things can get a mite confusing – and nowhere does terminology get more confusing than when we are talking ‘glass’.

But before we get into the idea of bringing lenses and sensors together I want to introduce you to something you’ve all heard of before – CONTRAST – and how it effects our ability to see detail, our lens’s ability to transfer detail, and our camera sensors ability to record detail.

Contrast & How It Effects the Resolving of Detail

In an earlier post HERE I briefly mentioned that the human eye can resolve 5 line pairs per millimeter, and the illustration I used to illustrate those line pairs looked rather like this:

5LPmm MTF, Lens & Sensor Resolution

5 line pairs per millimeter with a contrast ratio of 100% or 1.0

Now don’t forget, these line pairs are highly magnified – in reality each pair should be 0.2mm wide.  These lines are easily differentiated because of the excessive contrast ratio between each line in a pair.

How far can contrast between the lines fall before we can’t tell the difference any more and all the lines blend together into a solid monotone?

Enter John William Strutt, the 3rd Baron Rayleigh…………

Rayleigh MTF, Lens & Sensor Resolution

5 line pairs at bottom threshold of human vision – a 9% contrast ratio.

The Rayleigh Criterion basically stipulates that the ‘discernability’ of each line in a pair is low end limited to a line pair contrast ratio of 9% or above, for average human vision – that is, when each line pair is 0.2mm wide and viewed from 25cms.  Obviously they are reproduced much larger here, hence you can see ’em!

SensorContrast copy MTF, Lens & Sensor Resolution

Low contrast limit for Human vision (left) & camera sensor (right).

However, it is said in some circles that dslr sensors are typically limited to a 12% to 15% minimum line pair contrast ratio when it comes to discriminating between the individual lines.

Now before you start getting in a panic and misinterpreting this revelation you must realise that you are missing one crucial factor; but let’s just recap what we’ve got so far.

  1. A ‘line’ is a detail.
  2. but we can’t see one line (detail) without another line (detail) next to it that has a different tonal value ( our line pair).
  3. There is a limit to the contrast ratio between our two lines, below which our lines/details begin to merge together and become less distinct.

So, what is this crucial factor that we are missing; well, it’s dead simple – the line pair per millimeter (lp/mm) resolution of a camera sensor.

Now there’s something you won’t find in your cameras ‘tech specs’ that’s for sure!

Sensor Line Pair Resolution

The smallest “line” that can be recorded on a sensor is 1 photosite in width – now that makes sense doesn’t it.

But in order to see that line we must have another line next to it, and that line must have a higher or lower tonal value to a degree where the contrast ratio between the two lines is at or above the low contrast limit of the sensor.

So now we know that the smallest line pair our sensor can record is 2 photosites/pixels in width – the physical width is governed by the sensor pixel pitch; in other words the photosite diameter.

In a nutshell, the lp/mm resolution of a sensor is 0.5x the pixel row count per millimeter – referred to as the Nyquist Rate, simply because we have to define (sample) 2 lines in order to see/resolve 1 line.

The maximum resolution of an image projected by the lens that can be captured at the sensor plane – in other words, the limit of what can be USEFULLY sampled – is the Nyquist Limit.

Let’s do some practical calculations:

Canon 1DX 18.1Mp

Imaging Area = 36mm x 24mm / 5202 x 3533 pixels/photosites OR LINES.

I actually do this calculation based on the imaging area diagonal

So sensor resolution in lp/mm = (pixel diagonal/physical diagonal) x 0.5 = 72.01 lp/mm

Nikon D4 16.2Mp = 68.62 lp/mm

Nikon D800 36.3Mp = 102.33 lp/mm

PhaseOne P40 40Mp medium format = 83.15 lp/mm

PhaseOne IQ180 80Mp medium format = 96.12 lp/mm

Nikon D7000 16.2mp APS-C (DX) 4928×3264 pixels; 23.6×15.6mm dimensions  = 104.62 lp/mm

Canon 1D IV 16.1mp APS-H 4896×3264 pixels; 27.9×18.6mm dimensions  = 87.74 lp/mm

Taking the crackpot D800 as an example, that 102.33 lp/mm figure means that the sensor is capable of resolving 204.66 lines, or points of detail, per millimeter.

I say crackpot because:

  1. The Optical Low Pass “fights” against this high degree of resolving power
  2. This resolving power comes at the expense of S/N ratio
  3. This resolving power comes at the expense of diffraction
  4. The D800E is a far better proposition because it negates 1. above but it still leaves 2. & 3.
  5. Both sensors would purport to be “better” than even an IQ180 – newsflash – they ain’t; and not by a bloody country mile!  But the D800E is an exceptional sensor as far as 35mm format (36×24) sensors go.

A switch to a 40Mp medium format is BY FAR the better idea.

Before we go any further, we need a reality check:

In the scene we are shooting, and with the lens magnification we are using, can we actually “SEE” detail as small as 1/204th of a millimeter?

We know that detail finer than that exists all around us – that’s why we do macro/micro photography – but shooting a landscape with a 20mm wide angle where the nearest detail is 1.5 meters away ??

And let’s not forget the diffraction limit of the sensor and the incumbent reduction in depth of field that comes with 36Mp+ crammed into a 36mm x 24mm sensor area.

The D800 gives you something with one hand and takes it away with the other – I wouldn’t give the damn thing house-room!  Rant over………

Anyway, getting back to the matter at hand, we can now see that the MTF lp/mm values quoted by the likes of Nikon and Canon et al of 10 and 30 lp/mm bare little or no connectivity with the resolving power of their sensors – as I said in my previous post HERE – they are meaningless.

The information we are chasing after is all about the lens:

  1. How well does it transfer contrast because its contrast that allows us to “see” the lines of detail?
  2. How “sharp” is the lens?
  3. What is the “spread” of 1. and 2. – does it perform equally across its FoV (field of view) or is there a monstrous fall-off of 1. and 2. between 12 and 18mm from the center on an FX sensor?
  4. Does the lens vignette?
  5. What is its CA performance?

Now we can go to data sites on the net such as DXO Mark where we can find out all sorts of more meaningful data about our potential lens purchase performance.

But even then, we have to temper what we see because they do their testing using Imatest or something of that ilk, and so the lens performance data is influenced by sensor, ASIC and basic RAW file demosaicing and normalisation – all of which can introduce inaccuracies in the data; in other words they use camera images in order to measure lens performance.

The MTF 50 Standard

Standard MTF (MTF 100) charts do give you a good idea of the lens CONTRAST transfer function, as you may already have concluded. They begin by measuring targets with the highest degree of modulation – black to white – and then illustrate how well that contrast has been transferred to the image plane, measured along a corner radius of the frame/image circle.

MTF100 50 101 900x290 MTF, Lens & Sensor Resolution

MTF 1.0 (100%) left, MTF 0.5 (50%) center and MTF 0.1 (10%) right.

As you can see, contrast decreases with falling transfer function value until we get to MTF 0.1 (10%) – here we can guess that if the value falls any lower than 10% then we will lose ALL “perceived” contrast in the image and the lines will become a single flat monotone – in other words we’ll drop to 9% and hit the Rayleigh Criterion.

It’s somewhat debatable whether or not sensors can actually discern a 10% value – as I mentioned earlier in this post, some favour a value more like 12% to 15% (0.12 to 0.15).

Now then, here’s the thing – what dictates the “sharpness” of edge detail in our images?  That’s right – EDGE CONTRAST.  (Don’t mistake this for overall image contrast!)

Couple that with:

  1. My well-used adage of “too much contrast is thine enemy”.
  2. “Detail” lies in midtones and shadows, and we want to see that detail, and in order to see it the lens has to ‘transfer’ it to the sensor plane.
  3. The only “visual” I can give you of MTF 100 would be something like power lines silhouetted against the sun – even then you would under expose the sun, so, if you like, MTF would still be sub 100.

Please note: 3. above is something of a ‘bastardisation’ and certain so-called experts will slag me off for writing it, but it gives you guys a view of reality – which is the last place some of those aforementioned experts will ever inhabit!

Hopefully you can now see that maybe measuring lens performance with reference to MTF 50 (50%, 0.5) rather than MTF 100 (100%, 1.0) might be a better idea.

Manufacturers know this but won’t do it, and the likes of Nikon can’t do it even if they wanted to because they use a damn calculator!

Don’t be trapped into thinking that contrast equals “sharpness” though; consider the two diagrams below (they are small because at larger sizes they make your eyes go funny!).

ContrastUnsharp MTF, Lens & Sensor Resolution

A lens can have a high contrast transfer function but be unsharp.

SharpLowContrast MTF, Lens & Sensor Resolution

A lens can have low contrast transfer function but still be sharp.

In the first diagram the lens has RESOLVED the same level of detail (the same lp/mm) in both cases, and at pretty much the same contrast transfer value; but the detail is less “sharp” on the right.

In the lower diagram the lens has resolved the same level of detail with the same degree of  “sharpness”, but with a much reduced contrast transfer value on the right.

Contrast is an AID to PERCEIVED sharpness – nothing more.

I actually hate that word SHARPNESS; and it’s a nasty word because it’s open to all sorts of misconceptions by the uninitiated.

A far more accurate term is ACUTANCE.

acutance MTF, Lens & Sensor Resolution

How Acutance effects perceived “sharpness”.

So now hopefully you can see that LENS RESOLUTION is NOT the same as lens ACUTANCE (perceived sharpness..grrrrrr).

Seeing as it is possible to have a lens with a higher degree resolving power, but a lower degree of acutance you need to be careful – low acutance tends to make details blur into each other even at high contrast values; which tends to negate the positive effects of the resolving power. (Read as CHEAP LENS!).

Lenses need to have high acutance – they need to be sharp!  We’ve got enough problems trying to keep the sharpness once the sensor gets hold of the image, without chucking it a soft one in the first place – and I’ll argue this point with the likes of Mr. Rockwell until the cows have come home!

Things We Already Know

We already know that stopping down the aperture increases Depth of Field; and we already know that we can only do this to a certain degree before we start to hit diffraction.

What does increasing DoF do exactly; it increases ACUTANCE is what it does – exactly!

Yes it gives us increased perceptual sharpness of parts of the subject in front and behind the plane of sharp focus – but forget that bit – we need to understand that the perceived sharpness/acutance of the plane of focus increases too, until you take things too far and go beyond the diffraction limit.

And as we already know, that diffraction limit is dictated by the size of photosites/pixels in the sensor – in other words, the sensor resolution.

So the diffraction limit has two effects on the MTF of a lens:

  1. The diffraction limit changes with sensor resolution – you might get away with f14 on one sensor, but only f9 on another.
  2. All this goes “out the window” if we talk about crop-sensor cameras because their sensor dimensions are different.

We all know about “loss of wide angles” with crop sensors – if we put a 28mm lens on an FX body and like the composition but then we switch to a 1.5x crop body we then have to stand further away from the subject in order to achieve the same composition.

That’s good from a DoF PoV because DoF for any given aperture increases with distance; but from a lens resolving power PoV it’s bad – that 50 lp/mm detail has just effectively dropped to 75 lp/mm, so it’s harder for the lens to resolve it, even if the sensors resolution is capable of doing so.

There is yet another way of quantifying MTF – just to confuse the issue for you – and that is line pairs per frame size, usually based on image height and denoted as lp/IH.

Imatest uses MTF50 but quotes the frequencies not as lp/mm, or even lp/IH; but in line widths per image height – LW/IH!

Alas, there is no single source of the empirical data we need in order to evaluate pure lens performance anymore.  And because the outcome of any particular lens’s performance in terms of acutance and resolution is now so inextricably intertwined with that of the sensor behind it, then you as lens buyers, are left with a confusing myriad of various test results all freely available on the internet.

What does Uncle Andy recommend? – well a trip to DXO Mark is not a bad starting point all things considered, but I do strongly suggest that you take on board the information I’ve given you here and then scoot over to the DXO test methodology pages HERE and read them carefully before you begin to examine the data and draw any conclusions from it.

But do NOT make decisions just on what you see there; there is no substitute for hands-on testing with your camera before you go and spend your hard-earned cash.  Proper testing and evaluation is not as simple as you might think, so it’s a good idea to perhaps find someone who knows what they are doing and is prepared to help you out.   Do NOT ask the geezer in the camera shop – he knows bugger all about bugger all!

Do Sensors Out Resolve Lenses?

Well, that’s the loaded question isn’t it – you can get very poor performance from what is ostensibly a superb lens, and to a degree vice versa.

It all depends on what you mean by the question, because in reality a sensor can only resolve what the lens chucks at it.

If you somehow chiseled the lens out of your iPhone and Sellotaped it to your shiny new 1DX then I’m sure you’d notice that the sensor did indeed out resolve the lens – but if you were a total divvy who didn’t know any better then in reality all you’d be ware of is that you had a crappy image – and you’d possibly blame the camera, not the lens – ‘cos it took way better pics on your iPhone 4!

There are so many external factors that effect the output of a lens – available light, subject brightness range, angle of subject to the lens axis to name but three.  Learning how to recognise these potential pitfalls and to work around them is what separates a good photographer from an average one – and by good I mean knowledgeable – not necessarily someone who takes pics for a living.

I remember when the 1DX specs were first ‘leaked’ and everyone was getting all hot and bothered about having to buy the new Canon glass because the 1DX was going to out resolve all Canons old glass – how crackers do you need to be nowadays to get a one way ticket to the funny farm?

If they were happy with the lens’s optical performance pre 1DX then that’s what they would get post 1DX…duh!

If you still don’t get it then try looking at it this way – if lenses out resolve your sensor then you are up “Queer Street” – what you see in the viewfinder will be far better than the image that comes off the sensor, and you will not be a happy camper.

If on the other hand, our sensors have the capability to resolve more lines per millimeter than our lenses can throw at them, and we are more than satisfied with our lenses resolution and acutance, then we would be in a happy place, because we’d be wringing the very best performance from our glass – always assuming we know how to ‘drive the juggernaut’  in the first place!

Please consider supporting this blog.

This blog really does need your support. All the information I put on these pages I do freely, but it does involve costs in both time and money.

If you find this post useful and informative please could you help by making a small donation – it would really help me out a lot – whatever you can afford would be gratefully received.

Your donation will help offset the costs of running this blog and so help me to bring you lots more useful and informative content.

Many thanks in advance.