Greg's optimum image quality
Greg's photography pages
Greg's photo albums
Greg's photos
Greg's photo index
Groogle

This page is an accompaniment for the presentation I made on 13 August 2016. Many of the images are overlaid: run the mouse cursor over them to see the alternative.

Optimum image quality? I thought this talk was about raw image processing!

The thing is, raw images are just a way to get better image quality. They're nothing of importance in themselves. Let's look at the issues you have in getting a technically good image.

Digital image representation

The traditional representation of digital photographs is a series of square dots arranged in a rectangular pattern. Here's an image at three different scales:


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160713/big/Leonid-Rani-4.jpeg
Image title: Leonid Rani 4          Dimensions:          3515 x 3400, 2272 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Wednesday, 13 July 2016, thumbnails          All images taken on Wednesday, 13 July 2016, small
Diary entry for Wednesday, 13 July 2016 Complete exposure details

   
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160713/big/Leonid-Rani-4-detail.jpeg
Image title: Leonid Rani 4 detail
Complete exposure details
Dimensions: 800 x 856, 56 kB
Dimensions of original: 800 x 856, 56 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Wednesday, 13 July 2016:
thumbnails    small images    diary entry
 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160713/big/Leonid-Rani-4-detail-2.jpeg
Image title: Leonid Rani 4 detail 2
Complete exposure details
Dimensions: 300 x 225, 42 kB
Dimensions of original: 300 x 225, 42 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Wednesday, 13 July 2016:
thumbnails    small images    diary entry

Each dot, called a pixel (“picture element”), represents the three primary colours red, green and blue, so the format is called RGB.

Not red, yellow and blue? No. That works for art, but for optics it's red, green and blue, and it has been since the dawn of colour photography over 100 years ago.

The dimensions of an image is called the “resolution”, the number of pixels on each side of a rectangular image. Each pixel is represented as three numbers (one for each colour) between 0 and a maximum value which depends on the format. This is sometimes referred to as the “pixel depth”, and for technical reasons is often measured in bits. Common ones are:

Pixel       Used       Number of distinct       Number of distinct
depth       in       brightnesses per colour       brightnesses total
 
6       Monitors       64       262,144
8       Monitors, JPEG       256       16,777,216
12       raw data       4096       68,719,476,736
14       raw data       16,384       4,398,046,511,104
16       raw data, TIFF       65,536       281,474,976,710,656

Every bit of depth doubles the number of colours that can be represented. This corresponds to an extra EV of dynamic range.

There are a number of standardized RGB formats, but in photographic use only two are widespread:

Apart from JPEG and TIFF, a number of other formats are in common use, including PNG and GIF. Both can be lossless and much smaller than TIFF.

Real-life hardware

As shown above, cameras, monitors and photo printers all have different resolutions. A typical modern camera will have a resolution of 4800×3200 pixels and a pixel depth of 12 or 14 bits. But a normal monitor has only 1920×1080 pixels, often less, and a pixel depth of 6 or 8 bits. Even the aspect ratio (the ratio of the sides) is different: 3:2 or 4:3 for cameras, 16:9 for monitors, so a photo can't exactly fill a monitor screen.

In addition, neither cameras nor monitors have square pixels that can represent all colours uniformly. Modern camera sensors don't do RGB: each pixel represents a single colour, and monitor “pixels” are really stripes of the individual colours next to each other. Here's an example of a camera sensor and a photo of a monitor:

https://upload.wikimedia.org/wikipedia/commons/thumb/3/37/Bayer_pattern_on_sensor.svg/700px-Bayer_pattern_on_sensor.svg.png


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160714/big/Monitor-1.jpeg
Image title: Monitor 1          Dimensions:          4609 x 3456, 3248 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Thursday, 14 July 2016, thumbnails          All images taken on Thursday, 14 July 2016, small
Diary entry for Thursday, 14 July 2016 Complete exposure details

 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160714/big/Monitor-1-detail.jpeg
Image title: Monitor 1 detail          Dimensions:          1600 x 903, 240 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Thursday, 14 July 2016, thumbnails          All images taken on Thursday, 14 July 2016, small
Diary entry for Thursday, 14 July 2016 Complete exposure details

 

So taking photos and displaying them requires continual changes in format. We have at least:

  1. Take the image from the sensor and convert it to RGB. This requires some clever decisions, since the original pixels are all a single colour depending on the location. This process is called demosaicing. Depending on the desired image size, you may also need to reduce the size of the image.
  2. Take the RGB image and change its size, resize to the resolution of the monitor, and rearrange the pixels so that they match the positions of that colour on the monitor.

Normally the camera takes care of step 1, and the display software (web browser, for example) takes care of step 2. And everybody's happy. You can go home now.

What's wrong with this picture?

As long as you're happy with the way the picture comes out of the camera, you can really go home. But if you want to improve the images in just about any way, there are more things to think about:

Exposure compensation

What if the image is underexposed? The typical check for exposure is the histogram, a display of the spread of brightness in the image. Here's a typical (boring) photo and its histogram:


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/garden-nw-0+0EV.jpeg
Image title: garden nw 0+0EV          Dimensions:          4608 x 3456, 4272 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 July 2016, thumbnails          All images taken on Saturday, 30 July 2016, small
Diary entry for Saturday, 30 July 2016 Complete exposure details

   
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/Histogram-normal.png
Image title: Histogram normal
Dimensions: 261 x 148, 10 kB
Dimensions of original: 261 x 148, 10 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Saturday, 30 July 2016:
thumbnails    small images    diary entry

The histogram shows how much of the image is at each brightness level. There's a fair amount of darkness (under the covers), not much in the middle, and a fair amount of brightness (the sky). The right edge of the histogram doesn't drop to the bottom, which means that parts of the image (the sky) are overexposed. There's a lot more to say about histograms, but some other time.

Now look at this JPEG image:


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/garden-nw-0-1EV-ooc.jpeg
Image title: garden nw 0 1EV ooc          Dimensions:          4608 x 3456, 2624 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 July 2016, thumbnails          All images taken on Saturday, 30 July 2016, small
Diary entry for Saturday, 30 July 2016 Complete exposure details

 

It's taken from the same position at the same time, but at 1/500s instead of 1/60s, a difference of 3 EV. No wonder it's so dark, and that's what the histogram shows:

 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/Histogram-underexposed.png
Image title: Histogram underexposed
Dimensions: 262 x 143, 10 kB
Dimensions of original: 262 x 143, 10 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Saturday, 30 July 2016:
thumbnails    small images    diary entry

Most of the image is the area at the extreme left. Then there's nothing for a while, then the sky. If it's the sky you want, then this is your image, as you can see by looking at it. But if you want the foreground, it's as good as useless.

OK, our clever software allows us to compensate for underexposure. Here's the best I can get, along with the histogram:


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/garden-nw-0-1EV-fixed.jpeg
Image title: garden nw 0 1EV fixed          Dimensions:          4608 x 3456, 3840 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 July 2016, thumbnails          All images taken on Saturday, 30 July 2016, small
Diary entry for Saturday, 30 July 2016 Complete exposure details

   
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/Histogram-JPEG.png
Image title: Histogram JPEG
Dimensions: 261 x 147, 14 kB
Dimensions of original: 261 x 147, 14 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Saturday, 30 July 2016:
thumbnails    small images    diary entry

The best you can say is that it's better. But look at the histogram! Why is it so jagged? At 3 stops underexposure, all the pixel values are between 0 and 31 instead of 0 and 255. We're running out of numbers. And despite everything, the overall histogram is further to the left (dark). The bright parts (the sky) are all lost, and it's completely white.

Enter raw images

But the camera sensor has 12 bits, maybe even 14. Where did they go? They got lost when the image got converted to JPEG. They didn't have to: we could have kept the original.

And finally: that is the raw image, the one that hasn't been processed more than absolutely necessary. To start with it looks the same as the JPEG image, but let's see what happens if we try the same exposure compensation:


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/garden-nw-0-1EV-raw.jpeg
Image title: garden nw 0 1EV raw          Dimensions:          4608 x 3456, 5088 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 July 2016, thumbnails          All images taken on Saturday, 30 July 2016, small
Diary entry for Saturday, 30 July 2016 Complete exposure details

   
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/Histogram-raw.png
Image title: Histogram raw
Dimensions: 255 x 144, 10 kB
Dimensions of original: 255 x 144, 10 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Saturday, 30 July 2016:
thumbnails    small images    diary entry

It's not perfect, but it's a whole lot better than what you can achieve with JPEG. Not only are the shadows better; you can now see differences in the sky too. Arguably it's even better than the properly exposed image:


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/garden-nw-0-1EV-raw.jpeg
Image title: garden nw 0 1EV raw          Dimensions:          4608 x 3456, 5088 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 July 2016, thumbnails          All images taken on Saturday, 30 July 2016, small
Diary entry for Saturday, 30 July 2016 Complete exposure details

 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20160730/big/garden-nw-0+0EV.jpeg
Image title: garden nw 0+0EV          Dimensions:          4608 x 3456, 4272 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Saturday, 30 July 2016, thumbnails          All images taken on Saturday, 30 July 2016, small
Diary entry for Saturday, 30 July 2016 Complete exposure details

 

 

RAW or raw?

You'll frequently see the word “raw” written in capitals as “RAW”. This is a misunderstanding in the assumption that it's an acronym. As we've seen, names like JPEG and TIFF are acronyms. “Raw” is an English word you all know, and the Oxford English Dictionary includes this definition:

Uncooked; unprocessed, unrefined.

Raw images are ones that haven't been (completely) processed yet. So the correct spelling is “raw”. Note also that just about every manufacturer has its own raw format, since it's intimately coupled to the way the camera is built.

Is it worth it?

Of course, you don't go around underexposing things like that all the time. But raw images improve other processing too, though it's not as spectacular. Let's look at the pros and cons:

Contra raw images

Pro raw images

We've already seen a big advantage of raw images above. In general, any processing involves some quality loss, even with raw images. But it's much more with JPEGs because of the limited quality in the first place. Let's look at some of the things you might want to do, and how they compare with JPEG.

To summarize: nearly all of these modifications can be done with JPEG images too. But the results are better if you use the raw images.

How to set your camera

For best results, set your camera like this:

Which software?

Lots of software can now handle raw images. I've taken a look at some and used even fewer. Each requires getting used to its own way of doing things, which makes it difficult to compare things. At the meeting, it turned out to be a choice between three packages:

  1. Photoshop with Adobe Camera Raw. The obvious choice for Paul, since he already has it. It seems that it's a learning experience. His first result looked much worse than the corresponding JPEG (low output quality; see the JPEG conversion photo above).
  2. Lightroom. As I said at the beginning, I've tried it and I hate it (see this review). Paul said that everybody uses it, but later also that everybody hates it. It's clearly more than a raw converter, but it's also very expensive, though it's difficult to find out how much; the only price they show is $57.99 per month, which is clearly not right. On the other hand, you can find it on eBay for as little as $22, which also sounds suspect.
  3. DxO Optics “Pro”, which is what I use and what I used for the demonstrations. It has the advantage of the biggest library of lens distortion parameters, and it's much cheaper. The standard price is $US 129 or $US 199, but they frequently have half-price sales. It also has the great advantage that if you run into trouble with it, you can ask me.

So what to do? I suggested to Carol that she try both Lightroom and DxO (both available for a 30 day free trial) and make up her own mind. I'll be interested to see how she decides.

Here's the overview I prepared before the meeting:

Here a couple of examples from a photo we've already seen. They're a tiny section, about 45×60 pixels, so this is considerably enlarged. Here's the original size:

 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-uncorrected-detail-2.jpeg
Image title: Sample image uncorrected detail 2
Complete exposure details
Dimensions: 38 x 41, 18 kB
Dimensions of original: 38 x 41, 18 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 2 October 2015:
thumbnails    small images    diary entry

You don't see the individual pixels because the browser tries to smooth the image.

 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-uncorrected-detail-2.jpeg
Image title: Sample image uncorrected detail 2
Complete exposure details
Dimensions: 38 x 41, 18 kB
Dimensions of original: 38 x 41, 18 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 2 October 2015:
thumbnails    small images    diary entry
 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-Olyviewer-detail-2.jpeg
Image title: Sample image Olyviewer detail 2
Complete exposure details
Dimensions: 42 x 52, 22 kB
Dimensions of original: 42 x 52, 22 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 2 October 2015:
thumbnails    small images    diary entry
 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-DxO-detail-2.jpeg
Image title: Sample image DxO detail 2
Complete exposure details
Dimensions: 46 x 60, 28 kB
Dimensions of original: 46 x 60, 28 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 2 October 2015:
thumbnails    small images    diary entry
 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-ufraw-detail-2.jpeg
Image title: Sample image ufraw detail 2
Complete exposure details
Dimensions: 40 x 41, 18 kB
Dimensions of original: 40 x 41, 18 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 2 October 2015:
thumbnails    small images    diary entry
 
https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-rawtherapee-detail-2.jpeg
Image title: Sample image rawtherapee detail 2
Complete exposure details
Dimensions: 42 x 46, 18 kB
Dimensions of original: 42 x 46, 18 kB
Display this image:
thumbnail    hidden   alone on page
Display all images on this page as:
thumbnails    this size
Show for Friday, 2 October 2015:
thumbnails    small images    diary entry

These images are:

These are all very small sections of this photo (left-hand side of tank on the left):


https://lemis.nyc3.digitaloceanspaces.com/grog/Photos/20151002/big/Sample-image-uncorrected.jpeg
Image title: Sample image uncorrected          Dimensions:          4608 x 3456, 2080 kB
Make a single page with this image Hide this image
Make this image a thumbnail Make thumbnails of all images on this page
Make this image small again Display small version of all images on this page
All images taken on Friday, 2 October 2015, thumbnails          All images taken on Friday, 2 October 2015, small
Diary entry for Friday, 2 October 2015 Complete exposure details

 

 

Summary

Raw image processing isn't really something special. It's just one of a number of techniques to create better photos.


Greg's home page Greg's diary Greg's photos Copyright

Valid XHTML 1.0!

$Id: Raw-processing.php,v 1.7 2016/08/13 08:08:47 grog Exp $