skip to main content

Turning a day shot of railroad tracks into a late evening/night scene

Introduction: Making a night scene from a daylight shot

This page shows four examples of making a late-evening/night scene from a photograph of some railroad tracks taken in the late afternoon under a blue sky with lots of bright sunshine. Here's the "from the camera" daylight image that will be turned into a night scene:

Railroad tracks as shot

Viewing notes:

  • The images shown on the rest of this page have a dark overall tonality and ideally should be viewed in a darkened room. The darkest dark colors in each image measure between L=3.5 and L=5.0, which should be displayable on most monitors. If the images look light and desaturated, or if the images have crushed shadows and appear very saturated, then there's a good chance that there is a problem with your monitor black point. Or maybe I need to recalibrate and reprofile my own monitor. Or both.
  • On a small viewing screen you might not see much detail in such dark-tonality images. Also if the ambient light is very bright, you won't see much detail. So ideally the images are viewed on a larger display device under suitably dim ("editing" rather than "office" or "daylight") viewing conditions.

Night versions of the train tracks

The three "day into night" versions shown below are equal parts trying to capture what the scene actually would have looked like at night, and trying to make a pleasing rendition of what the scene would have looked like.'s Mesopic changes in color appearance was very helpful for figuring out Hue and Chroma modifications for turning a day shot into late evening or night. Equally helpful was spending a lot of time outside actually looking at how colors and lighting change over time and from various vantage points as the sun drops further and further below the horizon.

The stars were taken from a Stellarium screenshot of the night sky on the date of and near the location where the photograph was taken.

Day into night: three versions
Railroad tracks at night #1
Railroad tracks at night #2: darker tonality, bluer hues, and decreased saturation and local contrast
Railroad tracks at night #3: even darker tonality, but with increased saturation and local contrast

In an actual late evening/night scene, how much detail is visible in clusters of trees depends in part on whether the trees are silhouetted against a brighter background such as the sky (no visible details, just "soft dark" silhouettes), or instead are viewed against a darker background such as a hillside or more trees (a reasonable amount of visible detail, with "soft dark" shadows). Either way, there is a silvery quality to the appearance of real trees viewed in actual late evening light, that none of my versions of the "Railroad tracks at night" even come close to capturing.

The green colors in an actual late evening scene with trees and moonlight are considerably less colorful than in the image in Slide 1 above, and technically speaking the moonlight stripes across the tracks should be bluish instead of greenish.

Compared to Slide 1, Slide 2 is one step closer to what you might actually see outside on a clear moonlit evening: The stripes of moonlight are lower in tonality and also blue instead of green. Also the greens in the trees have been pushed farther towards a narrow range of low-saturation blue-greens, and with some help from RawTherapee's CIECAM02 module, the "darkest dark" shadows are softer. However, I suspect the lightness, local contrast, and overall saturation are still too high compared to an actual night scene, even when the scene is lit by a very bright full moon.

Slide 3 is even darker than Slide 2. Actual evening and night scenes don't have this much saturation, and I suspect they don't have this much contrast.

Processing notes

I processed the images on this page using darktable, GIMP 2.9, and RawTherapee, with most of the processing done in GIMP:


The camera raw file "day shot" was processed using darktable via the darktable GIMP plug-in. In darktable the only processing that I did was the actual raw interpolation plus applying the white balance, setting the raw white point, and rotating the image by a half-degree to straighten the horizon.

GIMP 2.9

Once transferred to GIMP, I cropped the image (just on the sides, nothing was removed from the top or bottom), and repaired some blown pixels in the sky. Then I used GIMP's LCH color tools and blend modes to turn "day into night", keeping the color and tonality modifications in two separate Layer Groups as shown in the slideshow below:

Making day-to-night color and tonality modifications
The daylight image
GIMP layer stack for turning day into night
Just the color mods applied to the daylight image
Just the tonality mods applied to the daylight image
Color and tonality mods both applied to make the initial conversion from day into night

Using RawTherapee's CIECAM02 module

While processing the images in GIMP, I was having trouble with the dark shadows under the trees as I tried to make these shadows very dark while still showing some hints of tonal variation. So I exported version #4 from GIMP and tried using RawTherapee's CIECAM02 module to work a bit of tonal variation into the deepest shadows. This worked out very well, so I imported the RT version back into GIMP and merged the RT-produced shadows under the trees into versions #2 and #3 as well as #4. In the future, whenever I'm having trouble controlling deep-shadow tonality, RawTherapee's CIECAM02 module will be my first stop.

I was curious to see what would result from using RawTherapee's CIECAM02 to make "day into night" starting with the camera raw file instead of an already heavily-processed image. Here is an example:

Railroad tracks at night just using RawTherapee (stars added using GIMP)

I don't especially like the purple color cast, but I think the tonality in the RawTherapee version shown above turned out really well, especially given the small amount of time I spent twiddling the RT CIECAM02 sliders before settling on the following edits:

  • Use the CIECAM02 hue slider to rotate the Hues 40 degrees counterclockwise to move the foliage hues towards blue-green. I haven't figure out how to use RawTherapee to apply different hue changes to different portions of the image, if this is even possible.
  • Use the various CIECAM02 Lightness and Brightness sliders and curves to darken the overall tonality and also lessen the contrast to make the scene considerably darker while somewhat preserving detail in the tree shadows.
  • Move the CIECAM02 Saturation and Colorfulness sliders to fairly negative values. I didn't use the Chroma slider. Looking at the image, the tree colors are still too saturated, especially the colors in the trees on the right side of the image. I think using these sliders to best advantage will require studying the interaction between Lightness, Brightness, Chroma, Colorfulness, and Saturation, both mathematically and also out there in the real world as light levels change.
  • Use the Color Toning module (this isn't a CIECAM02 module) to add an overall blue color cast, which ended up being more purple than blue, despite my having moved the hues considerably towards greener shades of blue. I think the Color Toning module might use HSV? Anyway, a better route (if it were available in RT) would be to use an LCH (or better yet JCH) color picker to pick the desired shade of blue, and then use Multiply to add the actual color cast, and then use a Lightness blend to restore the tonality.

I think the RawTherapee night-scene tonality is at least as good as (and more realistic than) the tonality in the four night scene versions shown in Section B above, and with a lot less effort on my part. The next time I want to make a night scene from a day scene, or otherwise want to modify deep shadow tonality, RawTherapee will be my first stop instead of my last stop, simply to get the tonality to a good starting place for further editing in GIMP. And I'm really wishing that GIMP had the same CIECAM02 capabilities as RawTherapee.

When I made the RawTherapee night scene shown above, basically I was just twiddling dials until I saw something that looked OK. Randomly twiddling dials is not the best way to approach editing an image!

As part of figuring out how the the RT CIECAM02 module works, my first goal was to figure out what specific settings for "Preferences/Color Management", "Scene Conditions", "Viewing Conditions", and "Colors/White Balance" result in "no change at all", or at least minimal change in the image appearance, before I actually start using the algorithms provided under "Image Adjustments". Here's what I've found so far:

There are three parts to the RT CIECAM02 module:

  1. Scene Conditions
  2. Image Adjustment
  3. Viewing Conditions

The following CIECAM02 settings for the Scene and Viewing Conditions seem to produce no change to the image's appearance (of course assuming you haven't made any changes to the Image Adjustment portion of the CIECAM02 module):

  1. Under "Preferences/Color Management" set:
    • Output device's white balance to "5000K" (regardless of your monitor's actual white point)
    • Output device and Scene Yb Luminance both to "Yb=18 CIEL#50"
  2. For already interpolated images opened from disk, leave the Colors/White Balance on "Camera" (even though this seems odd), which sets the white balance to Temperature 6490/Tint 1.002, with the B/R equalizer at 1.000. For a raw file, set the white balance that's appropriate for the image lighting conditions.
  3. Activate the CIECAM02 module and use these settings:
  4. Scene Conditions:
    • Set CAT02 adaptation to 100%
    • Don't check "Dark surround" (use an appropriately lighter theme, which RT doesn't currently seem to provide)
    • Choose WP Model: WB[RT]+[output]
    • Leave "Scene luminosity" at the default value, or else use these resources to calculate the scene luminosity:
      1. EV can be calculated from ISO, shutter speed, and f-stop, but the resulting EV value is only accurate for the scene conditions (that is, the lighting conditions under which the image was actually shot) if the image wasn't deliberately underexposed to avoid blowing out the highlights, or overexposed from ETTR to minimize noise in the shadows.

        This seems like a very iffy way to get the actual scene EV, as it doesn't allow for spot metering and other intentional and accidental ways that one might produce an image using camera settings that don't reflect the actual scene luminance.

      2. Fred's Ultimate Exposure Guide can be used to estimate the actual scene EV, assuming you remember the lighting conditions at the time the photograph was taken, or if there's enough information in the image contents to allow an estimation of the lighting conditions.
      3. Once you have the scene EV value, you can convert from EV to candelas/meter squared.

      The railroad tracks image was taken on a sunny "clear blue sky" late afternoon. Using Fred's Ultimate Exposure Guide, I'm estimating the scene EV to be somewhere between 12.5 and 13.5 EV, let's say 13.0 EV. Using the "EV to cd/m^2" calculator, the cd/m^2 for the scene is between 724 and 1448, call it 1024, which does brighten the image by a very small amount, compared to not using the CIECAM02 module. Even when pushing the Scene luminosity slider as low as it will go, there is a slight brightening of the image.

  5. Image Adjustments: Of course don't make any image adjustments until you are satisfied that the mere activation of the CIEMCAM02 module isn't causing changes in the image appearance.
  6. Viewing Conditions:
    • Viewing luminosity: Set to the same as the Scene luminosity
    • Surround: Average
    • My test image has a small color gamut and Gamut control seemed to make no difference. For the raw file, under the Raw tab I used the Hot/Dead pixel filters, so I wouldn't expect the Hot/bad pixel filter to do anything, and it didn't seem to. But there's probably no reason to uncheck these options.

Of course if you are preparing an image for output to some device A under some viewing conditions B, the above settings aren't going to be appropriate. My goal was to use the CIECAM02 module as one step in a workflow in which most of the editing is done in GIMP. For this purpose changes in the image appearance to accommodate some hypothetical display device viewed under some hypothetical viewing conditions are completely irrelevant.

Parting thoughts:

Sometimes I have trouble letting go of an image, and "Railroad tracks at night" is such an image. I had a lot of fun turning the day scene into a night scene. Along the way I learned a bit about color mixing and colors at night, and also started digging a bit into what CIECAM02 is and how it might be useful for image editing. I'll probably make at least one more version, this time taking advantage of the RawTherapee CIECAM02 module.