Color-Grading Challenge: Turn Day Into Night

For weeks I’ve been experimenting to see if Shotcut has enough color-editing tools to be able to turn a day-time video into night. So far, no luck on my end. I want to see if my more experienced colleagues have better ideas.

Here is a frame of reference on how to do it on Davinci Resolve.

If you want to play, use this video: 8400916-uhd_3840_2160_25fps.mp4 - Google Drive

I want to see if anyone has better luck than myself, and maybe we can turn it into a Filter set.

Here’s how far I’ve gotten

Hey Ben !

Here’s what I came up with… so far

I guess this is the kind of stuff that you could spend hours on and never be completely satisfied. Also, while I kind of like the result on that clip, the same filters don’t work so well on other clips. :face_with_raised_eyebrow:

Nice challenge though. I’ll try again tomorrow :slight_smile:

3 Likes

Looks better than mine!

Here’s a second one using the following filters:

  • Color Grading
  • Hue/Lightness/Saturation
  • Contrast
2 Likes

I prefer your 2nd version Ben :slight_smile:

Since I’m waiting for the UPS guy, I made another one.

I used Saturation and Color Grading in my first try.
I added a radial gradient in the sky on that one.

3 Likes

Based on how the shadow was falling, I added a light source.
To finish it off, I added a little bloom.

3 Likes

The fact that the sky is too bright in the night shot makes it look bad, if there’s a way to reduce the sky highlights and increase the foreground shadows brightness, it would look much better.

Avec 2 LUTs dont une réglable en intensité.

With 2 LUTs, one of which is adjustable in intensity.

3 Likes

Cool challenge! I used a two-phase approach. Phase 1 was to do a realistic day-for-night conversion. Phase 2 was to stylize the realistic version by forcing it to a single color like Mad Max did. Here are my results:

Realistic:

Stylized:

Step 1: Contrast
Contrast

In the DaVinci Resolve tutorial, Waqas simulated the lower light level of the moon by lowering the exposure. This doesn’t work great in Shotcut because image data is stored as 8-bit integers, not 16/32-bit floating point numbers. (I’m assuming that GPU Effects are off.) Lowering exposure as a first step will irreversibly crush out useful details in the shadows. This is why 8-bit filter chains generally save filters that darken the image for last when possible.

With that in mind, I’ve chosen to reduce contrast instead of lower exposure, which simultaneously darkens the highlights and raises the shadows. This also better mimics a nighttime environment where clouds, humidity, and haze diffuse the moonlight into the shadows and reduce perceivable contrast compared to sunlight. Raising the shadows with the Contrast filter also has a side benefit of the image data being more easily manipulated by the remaining filters without being so dangerously close to the zero-clip point.

How much contrast to reduce? A good start point is where the brightest part of the image is just under the 75% mark on the RGB parade (the 191 line on Shotcut’s scope). Allowing more contrast can create a golden hour look, while less contrast will create flat lighting similar to midnight.

RGBParade

Step 2: White Balance
WhiteBalance

When video footage is shot near noon time, the colors will be vibrant because of the full-spectrum light from the Sun. But the moon does not provide such a full spectrum of light. The moon “averages” around 4100K as opposed to the Sun’s 5600K. I say “average” because horizon angle and atmospheric conditions can change the perceived temperature. But generally speaking, adding a White Balance filter of 4100K puts us in a good place of simulating the temperature of light provided by the moon, which will eliminate colors that only full-spectrum sunlight would reveal.

Step 3: Color Grading
ColorGrading

If the moon reflects warm light from the Sun, why do we associate blue with nighttime? That is the Purkinje shift in action. We can simulate this with the Color Grading filter. For my example, I pushed shadows to pure blue, midtones to cyan, and highlights a little towards orange to prevent skin tones from looking cold and lifeless. This color split also explains why turning the entire frame blue rarely looks realistic. The Purkinje shift only turns low-light areas blue (technically minus-red), whereas bright areas should remain closer to neutral or warmer color. Then I raised the midtone level and lowered the highlight level, which is a further reduction of contrast. However, this differs in function from the first Contrast filter. The first Contrast filter was to reduce overall light levels to proper nighttime brightness. The contrast I’m creating here with the tone sliders is strictly to manage perceived color differences. There is a separation of duties there.

Step 4: Hue/Lightness/Saturation
HLS

When light is low, human eyes don’t perceive saturation as well. Therefore, I’m knocking Saturation down to 85% here to make the footage look like it didn’t have the saturation advantage of full sunlight when it was captured.

There is usually no need to touch Hue or Lightness here. Lightness should be handled by previous contrast adjustments, although changing Lightness here can be a quick fix if on a deadline.

Step 5: Deband
Deband

These filters have really stretched 8-bit data past its limit. In my example, the solid-color areas like the sky and pavement have started to show banding. To counteract this, I added a Deband filter and raised the pixel range until the banding went away.

This is my stopping point for a realistic day-for-night conversion, with obvious tweaks as necessary when the footage changes. As a side note, this process is pretty similar to a retro-film filter chain except for the Color Grading values. Here is the same footage with the first Contrast filter at 57% and all of the Color Grading wheels pushed to the right:

Now back to getting a Mad Max stylized look…

There are several ways to force an image to a single color, but I’m doing the fast method here. I put a color clip on a track above my footage, which will be the color being forced. The final result is very sensitive to this color choice, and I used RGB(37,120,192) as a start point. Then I added an Opacity filter at 89%, then a Blend Mode filter in HSL Color mode. This allows me to replace colors in the underlying footage at a strength I specify using Opacity. (It is also possible to set Saturation on the footage to 0% to turn it black and white, then use an Overlay blend mode on the color clip to colorize the B&W footage.) I also relaxed the first Contrast filter to 55% and relaxed the Color Grading tone sliders to get more brightness in the clouds to match the Mad Max look. The result is the “Stylized” image at the start of this post. There is a lot of flexibility to edit to taste from here.

EDIT: It just dawned on me that a much faster way exists to find the perfect color when forcing an image to a single color. Create the color clip as before, but choose one of the three full-saturation colors: red, green, blue. As in, RGB(255,0,0) for red. Then add a Hue/Lightness/Saturation filter at the top of the stack. Experiment with the Hue and Saturation sliders until the perfect color is found.

BlendHue

If anyone wants to shoot their own day-for-night footage, here are some tips to keep in mind:

  1. Shoot close to noon unless there is a reason not to. At noon, there aren’t long crisp shadows being cast. Those are a dead giveaway that the scene was lit by the Sun, not the moon. However, some creepy swamp movies want long shadows to make tree branches look menacing, in which case capturing long shadows is desirable.
  2. If the option exists, diffuse any remaining shadows to simulate the moonlight being diffused by the nighttime humidity and haze.
  3. If using reflectors to bounce sunlight, consider gold reflectors instead of silver or white. When adding blue during color grading, bounced white light will turn blue, whereas gold light will turn white.
  4. Be very careful about showing the sky. The sky will usually be too bright compared to the ground. Also, the cloud types will likely be wrong compared to nighttime clouds due to temperature differences.
4 Likes

I like the shade (or hue?) of blue you ended up with. :+1:
Thanks for the useful tips and info.

I quickly watched parts of this video this morning. I’d love to get such impressive results just in editing. But from what saw in the video and the tips you shared, half the work should be done while shooting the footage.

This is why I added the Gradient filter in my 2nd attempt. Instead of trying to darken the sky, I made it brighter, as if there was a full moon out of frame above the scene.

But there are 2 problems…
First: No keyframes in the Gradient filter. On this clip it’s not a huge problem though since the camera doesn’t pan too much.
Second problem: Such a bright moon would cast some light on the girl and on parts of the right side of the scene. That would be difficult to create.

Despite this, I prefer this version over my first one. :grimacing:

3 Likes

Very extensive explanation!

1 Like

Yeah, that was clever. I wonder if brightening the ground to match the sky would work, then darken both to nighttime levels.

Sorry @bentacular for going overboard lol. I had to do a day-for-night shoot less than a week ago for a project, and I used your challenge as an opportunity to catalog all my notes.

2 Likes

That’s a great idea. I was looking for a way to create a beam of light natively.

1 Like

Just to chip in here to congratulate everyone for these fantastic efforts. I can’t find any free time right now to try this myself (busy working on some flute tunes for Christmas), but I’m following - and I’ve learned a stack of stuff from this thread. Thanks, guys, keep the challenges coming! :sunglasses: :+1: :+1:

2 Likes

I did some thinking and experimenting to find a way to make the sky darker before applying the filters needed to create the Night from Day effect. My conclusion was that I needed an animated mask that isolates the sky from the rest of the video.

It’s possible to do it with a Mask: Glaxnimate filter. But it would be incredibly long and tedious.

So here’s what I did:

I imported the clip in Shotcut and applied a Threshold filter.
This turn each pixel black or white, depending on its brightness. As a result, bright areas of the clips are turned to white and the darker areas are turned to black.

Most of the sky is now completely white. But the ground is also white. So I made it black with a Glaxnimate clip (Open other > Animation (Glaxnimate)

Now there’s only a small part of the sky, on the top left corner, that needs to be turned to white.

I also used Glaxnimate here to create an animated white patch on that corner…

Now that the sky is roughly isolated, I exported, and the resulting clip will be used as a animated mask.

I then started a new project and imported the original clip on track V1, and added a copy on track V2

Then:

  • Add a Mask: From File filter on the clip on V2, and choose my previously exported clip as a Custom mask.
  • Turn Invert ON. (Note: I could have avoided that step by making the bright areas black an the dark areas white earlier… Will do next time)
  • Add a Levels filter and reduce the Output White value to darken the sky.
  • Select the Output and add the filters needed to apply the Night from Day effect on the entire Timeline.

Result:

This is not perfect. I could have worked more on the mask to make it more accurate, particularly on the top left corner, but it was fun to do. And I learned that when the conditions are right, it’s not too hard to created an animated mask from a video.

I’m sure I didn’t invent anything new here. When you think of it, this Threshold is obviously a great help to create a mask. So no doubt it’s often used in video editing by a lot of people. I just wasn’t aware of it before today.

2 Likes

Wow! So my takeaway is you can use the Threshold technique theoretically to knock out background, if the right conditions apply

Well, yes. I guess it can also be used to remove a background if there is enough contrast between the subject and its surrounding. Worth trying.

1 Like