 |
|
 |
 |
 |
  | Here is a view of the merged result (equivalent gamma 2.0).
|
 |
 |
 |
 |
 |
  |

M42.mergedHDR.gamma0_5.tif
Although this may not look like much, there is a wealth of detail preserved in this image. A few more operations will bring it out. Specifically, the background sky is not neutral, and the low level signal needs to be amplified. We want to do this without sacrificing high level signals and without introducing clipping artifacts.
|

|
|
 |
 |
 |
 |
 |
  | A closer look at the low portion of the histogram of the HDR image.
 These are bins in a 16-bit linear scale for M42.mergedHDR.exr.
|
 |
 |
 |
 |
 |
  | The differences in peak locations represents the distinct color of the sky through which the photograph is taken. We want to remove the light added to the exposure by the sky, but it is important to not simply offset the peaks to zero. This would result in visual artifacts by the hard clipping to black. Even though the spread in the histogram mostly represents noise, there is also signal from faint objects in the scene (the reason for the asymmetry in the skirts of the distribution). We need to preserve the noise in order to have the image show pleasing shadow detail, but we want to remove the light of the background (actually foreground) sky.
|
 |
 |
 |
 |
 |
  | To do this, identify the minimum levels in the image. This will not be a constant, especially in the presence of light pollution, which shows as an illumination gradient across the frame. Several image processing operators can obtain an estimate for the sky, but the basic concept is find the minimum pixel levels over a local neighborhood. A min filter with a range of around 1/10th the image size works well. This operation can be approximated in Photoshop using its "darken" blend mode over several translated layer copies of the image. I used an "erode" operation in Matlab, (along with some other operations to remove outliers), which finds the minimum over its operator range. When done, an image that represents an approximation to the background sky is obtained.
|
 |
 |
 |
 |
 |
  |  Here is the local minima image (scaled by 64X to show the variations). It is not a perfect representation of the sky, because there is some influence from the objects in the scene, but the errors are tiny.
|
 |
 |
 |
 |
 |
  | The min image is subtracted from the original. This will ensure that all of the original data is still present (apart from some minor clipping at zero), we have removed the bins that have no counts in them, but the peaks are not aligned yet, so there is still a color cast in the image.

|
 |
 |
 |
 |
 |
  | Apply a curve that maps the peaks of these to the same (highest) position. The curve preserves relative bin positions at the peak and continues at unit slope thereafter.

|
 |
 |
 |
 |
 |
  | After subtracting the min image from the original (floating point) HDR image, and then applying these curves, the result shows the channel histograms nearly superposed (albeit with bin counts re-distributed accordingly).
 We now save this result to a format that can be imported into Photoshop for final tone mapping.
|
 |
 |
|


 |
 |
 |