The quest for HDR

I have been on a quest to create HDR video for a long time. This would be particularly useful for taking videos of lightsabers because of the intense brightness of the blades. If you watched season 7 of “Clone Wars” on an HDR TV, you know what I’m talking about.

Even if you did, you might not know what HDR is. HDR stands for High Dynamic Range, and if you don’t have it, you should fix that. Basically, HDR lets you use a higher range of brightness and colors than what is possible on an sRGB monitor or HD TV. In saber speak, this is the difference between “red” and “deep red”.

Youtube already has a good chunk of HDR videos on it. Here is one that I quite like:

Of course, you will need an HDR capable youtube player to view it properly…

Anyways, I recently bought a new camera that can actually take HDR videos. However, uploading HDR videos to youtube turns out to be interesting, because when youtube takes the HDR video and converts to a regular video. (Which is what most people will see…) the result is very very boring in most cases.

The solution turns out to be to incorporate a LUT (LookUp Table) into the video before uploading it. This LUT will tell youtube how to convert the video to regular video. Of course, most tools for working with LUTs are expensive and not open-source, but it turns out that the LUTs themselves are fairly simple things, so I wrote a small script to generate a lut.
mklut.pike (1.3 KB)

This script is pretty dumb right now, but it did work and my test video came out better. Next I plan to add some way to adjust the LUT for more/less brightness so that the output video can look better. I also need to write a small tool to extract a frame from the video, apply the LUT and show the frame so that I can adjust it until it looks good.

I plan to make some test videos with lightsabers soon, stay tuned.


Interesting read Prof.

While I don’t profess to understand the intricacies HDR video, I understand the principle of high dynamic range, but I’m interested to read that you believe it will make our sabers look better, as I actually think it will have the opposite effect.

High dynamic range gives the camera the ability to resolve detail on extreme highlights and extreme low lights at the same time. But is that what we want when filming replica lightsabers?

The reality of our sabers is that they are lights inside plastic tubes. The only time they look like “real” lightsabers on video is when the camera cannot cope with the light level of the blade, as this makes the blade tube burn out (turn white) and over-expose, leaving just the colour of the blade flaring around the edges. This is why everyone turns the lights out when filming their sabers - it forces the camera to try to expose for the dark areas, and when it does the blade over-exposes and looks more “real”. Contrast this with a replica lightsaber shot outdoors in daylight. In this situation, the dynamic range of the actual scene is much less - the prevailing daylight is almost as bright as the blade - so a normal camera has sufficient dynamic range to accurately resolve both. But the result is a much less realistic looking lightsaber because the blade tube is revealed and resolved much more accurately (in terms of what it really looks like) but much less realistically (in terms of looking the way they look in the movies).

It seems to me that HDR is the very last thing we need to make our lightsabers look real, because it will be able to cope with the brightness of the blade and will therefore resolve detail in it without flaring, revealing it to be a plastic tube.

For my part, when filming lightsabers, I go out of my way to reduce the camera’s ability to cope with contrast and high dynamic range, by using nothing more than a mobile phone with a soft filter over the lens and natural daylight through my Velux window which gives sufficient, but not excessive, light to balance the exposure. More importantly though, I use a simple app to lock the exposure parameters, specifically in order for the blade to be allowed to overexpose and ‘flare’.

I actually made a short video about making lightsabers look real on camera:

And here’s another video made using the same techniques:

There’s also an article on it that I wrote in my fun little lightsaber magazine The Saberist which I include with all the sabers I sell. I’ll try and upload it somewhere when I get a sec.

All of that said, I keep an open mind on how HDR might work with our sabers, and I also know better than to doubt your theories on such things Fredrik, especially once you have the bit between your teeth. Which leads me to think that we may be talking at slight cross-purposes. But I await further developments with interest.


1 Like

This goes to the intent of the video, which is important. When filming lightsabers, there are at least two schools of thought:

  1. You want the video to convey what you see in person when using the ligthsaber.
  2. You want the video to look like the lightsabers in the movies.

Of course, the lightsabers in the movies are post-processing effects. They have the same color and brightness whether you are in the dark or not. Overwelming the camera gives a very similiar effect. However, if your goal is to reproduce what you see, HDR should be really cool I think.

If your saber is bright enough, it will also overwhelm an HDR camera, and the result will be just as movie-like, while also providing a lot of additional detail and contrast in the darker areas. Doing that will require some experimentation though.

For many of my videos I’ve been using reflections to show what is actually happening on the blade, like this:

I’m hoping that by using HDR, the reflection trick might not be required anymore.


HDR experiment #1

This video was taken with the HLG2 setting on my camera.
The light saber still completely wipes out any color information and is generally rendered as white, even in the HDR video. Next time I will be trying the HLG3 setting.

First I uploaded the video without any LUTs:

Then I uploaded it with the LUT from the program in the top post:

Then I created a lut where SDR max is equal to the HLG 50% code point:

Finally I created a LUT with SDR max is equal to the HLG 60% code point, and I made it so that it clips without changing colors.

Note, if you are watching this in HDR mode, then all the videos will look the same. Only the SDR (standard dynamic range) render is different between these movies.

I think I need to experiment a bit more with the clipping functions though, because color-preserving clip basically removes all highlights in the picture.

1 Like

Yet another LUT. This one uses clip-to-white. This should avoid orange colors becoming yellow when clipped.

1 Like

Well I must say, It does look better than standard video. Not so much washing out and you can just make out the details of the candy cane. The flame style came out nicely too.

Took another video, this time using the HLG3 setting on the camera. I think I like HDR3 better. The blade still manages to wash out the colors though.

First, no LUT:

Same video, but with with a LUT computed to have SDR = 50% of HLG + clip-to-white.
I think maybe I should be using the rec1884 transfer function instead of rec709, as the colors come out a bit strong in this video I think.

I must view these on my tv.
But it looks like you are having fun with this lot😁

edit… I watched these on my 4k HDR TV and the colours are deffinately more defined.
i noticed when you swing the blade that you get to see more definition on the colours than when the blade was static.

I think my next step will be to try having more light in the room and on me, maybe that will step down the aperture enough that the color of the blade will show up better.


Who’s narrating? Werner Herzog?

Still trying to figure out how to embed a video here. Is there an info page on it?

<iframe width="560" height="315" src="" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

<iframe width="560" height="315" src="" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

I still can’t figure out how to embed a youtube video here. I guess i’ll go try to read more about discord?

<iframe width="1190" height="669" src="" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


Odd, I can only add videos from my mobile device? On PC doesn’t work but via phone it does?

I just paste in the url, but it seems like it doesn’t like urls for some reason.

Try another way:

Ok, grabbing the url direct from browser worked. I guess youtube tracks shares with those links? Grab a direct URL. Got it. Still getting used to it, but wanted to make sure I had the ability to post vids with the devlt. that is coming.

Just had another silly idea: What if I used error-distribution to push color drift off to nearby pixels?
Basically, when a pixel is too bright, it becomes white, but nearby pixels would then need to absorb the color that was lost while making that pixel white. Unfortunately there is no way to do that with a LUT, so it doesn’t fit into the youtube uploading system, but it could be interesting to experiment with, and it’s kind of what we want for the lightsaber effect anyways: A white core with a halo that shows what the color is.