logo Sign In

Post #669907

Author
Spaced Ranger
Parent topic
THX 1138 "preservations" + the 'THX 1138 Italian Cut' project (Released)
Link to post in topic
https://originaltrilogy.com/post/id/669907/action/topic#669907
Date created
8-Nov-2013, 6:35 AM

Previously, I mentioned the 16mm print (which I believe is THX 1138 ver.1) has a non-uniform brightness across what should be a dark, flat background during the opening titles:

                 background brightness variation                            uniform self-correction (explained below)
 

Normally, one would think it to be a center-spotlight effect and there are Avisynth filters to handle such specific situations. This, however, is different. There is variation across the frame, but it's mostly darker in the vertical center and lighter towards the vertical sides (optical printer light leakage?). The best solution is to use itself as it's own correction. Here's how I worked that out.

First, for this to be effective, the film needs to be brightness stabilized (which it is not). My demonstration here is only on select frames, to prove a concept. As this is a laserdisc preservation thread, I probably won't take it beyond this. But the steps I outline to do this in a paint program are reproducible in Avisynth.

Second, I'm thinking that this technique should be applied independently to each color layer. As this is a faded print, it should not be assumed that all the layers are equally affected by this anomaly. For this demonstration, I applied the correction as a single brightness correction. Even still, it is an improvement -- most noticeable in the flat title graphics, but less so in the live film that is naturally non-uniform.

 

Using the THX  1138 title graphic as my sample, this process is applied in the paint program's Layers -- using frames that were approximately the same background-brightnesses, to compensate for lack of brightness stabilization:

This frame needs to be processed by a "clean version of itself". Fortunately, there were  complete "blank" frames  in this scrolling title sequence. If there were none, a clean frame would need to be constructed from an assembly of blank areas of different frames.

As the picture is grainy, I didn't want that grain to apply itself into the correction. Several grabbed blank frames, at matching overall brightness, are blended together by temporal smoothing. The randomness of the grain in each works to cancel out the others (yes, it really works!). The more frames, the more randomness, the better the random grain self-cancellation. As each blank background is added for temporal smoothing, it's count from the bottom becomes it's applied percentage of opacity -- according to this technique:
  * base layer -- 1st layer from bottom (1 of 1)  -- set to 100% opacity
  * 2nd layer   -- 2nd layer from bottom (1 of 2) -- set to   50% opacity
  * 3rd layer    -- 3rd layer from bottom (1 of 3)  -- set to   33% opacity
  * 4th layer    -- 4th layer from bottom (1 of 4)  -- set to   25% opacity
and so on. They are grouped together here for organization:

To remove the color and work strictly in luminance, the merged blanks are desaturated (0% color):

As this is supposed to become a flat background, the reverse of the brightness variation will be averaged itself to produce flat brightness. This is accomplished by inverse:

Of course, inverse works across the entire dark-to-light spectrum and our darkness has become inverted to lightness. With levels, the lightness can be brought down back to it's original darkness baseline (but still inverted). By using a Histogram function, one can see the range-spike of the picture both before and after the inversion. In this case, the range before was 32-54 and the range after is 181-213. Therefore, the high range is brought low in levels with:
  * Input low    = 181
  * Input high   = 213
  * Output low  =   32
  * Output high =   54
and is so applied:

That is the correction for any frame to which it is applied (using the paint program Screen overlay), and it grouped together for organization. You can see, however, I had to include an additional adjustment at the very top of Layers. The result was overall lighter than is should've been. To compensate, a simple adjustment using levels, from 36-255 to 0-219, slides the spectrum down by 36.

 

All this, applied to the original title frame, produces an excellent result:

To test the effectiveness of this process, I also applied the correction to a blank background. The before and after range-spikes where expanded to full spectrum to easily observe their density distributions:

                    density distribution before                                               density distribution after
  

Success! It actually works!
Here is the title frame, self-corrected from the 16mm's own non-uniform brightness, shown full-sized, before & after: