logo Sign In

snicker

User Group
Members
Join date
10-Jul-2010
Last activity
6-Feb-2024
Posts
92

Post History

Post
#619771
Topic
Info: New colormatching script
Time

G-force, what I've posted above is a very simplified version of just the initial de-clipping pass. There are 5 passes at shadow clipping in total and each one uses a 'new' RGB source (generated in the previous pass) as its target.

I've used a lot of curves adjustments, and numerous filters and third-party plug-ins, which would all require accurate translation to match up to what I have assembled in After Effects.

The example above is an easy port but it gets a lot more complicated after this step.

 

You_Too, I will at some point post a tutorial if I can figure out a way to present it. I have a full workload at the moment so it won't be happening for a while but I will aim to post some before/after shots.

 

G-gorce, if you have no objections, I could post a few samples in this thread. It might be easier if I post images and then answer questions about how the results are obtained.

Post
#619564
Topic
Info: New colormatching script
Time
snicker,

we need to try to port your clipping removal to Avisynth. Any chance you could provide a tutorial on how you do it? I know you did already in another thread, but I can't seem to find it, and I remember not quite being able to follow it previously. Any chance you could take another stab at explaining it to us?

-G

I'm not sure how you would accomplish this. It's assembled in After Effects and uses an intricate system of layer masks and colour keys and several 3rd party AE plug-ins. You would have to duplicate the functions of these plug-ins to port it to AVISynth.

As for explaining how it works... it's a little convoluted but the basic idea goes like this:

Each colour channel is corrected separately. Below is a simplified version of how the red channel shadow detail is restored (AE layer order).

  • Duplicate source video layer (red channel luma) - clipped shadows keyed
  • Duplicate source video layer (green channel luma) - blend mode 'lighten'
  • Duplicate source video layer (blue channel luma) - blend mode 'lighten'
  • Source video layer (red channel luma)

 

The opacity of the blend channels is set to something like 2%-5%. This is enough to restore editable data (if it exists). There is (a lot) more to it than that but this is the easiest way of describing the basic function.

The individual luma channels are then recombined to form a new composite RGB channel. Further edits can then be made to this new video layer.

The reason for using such low opacity is that if highlight colour clipping is present in any of the blend layers (and it often is) it will be introduced to the source channel and screw with the colour. This can be avoided by keying clipped highlight colours from the blend layers allowing for higher opacities.

Post
#618997
Topic
Harmy's THE EMPIRE STRIKES BACK Despecialized Edition HD - V2.0 - MKV & AVCHD (Released)
Time

INv8r_ZIM said:

Well, I know where in ESB the clipping and crushing bug me the most - in the first Imperial fleet shots and in the Falcon's escape from Hoth.   The loss of detail in those is so atrocious that it distracts me every time.  Would there be any point in running those sequences, or those and and a handful of others through your custom scripts and plugs, Snicker?  Would certainly cut down on the render time if the process can be targeted where it really needs it.  Encode lossless and Harmy should be able to just drop those shots into his timeline.  As  understood it, Snicker, these are on your work machines, no?  Can you tie up render time if that's the case?

 

Apologies for the late reply. Yes, this is a work machine so unfortunately can't be tied up rendering. I am open to trying it on a few shots but don't have a capture of ESB.

Post
#616454
Topic
Harmy's THE EMPIRE STRIKES BACK Despecialized Edition HD - V2.0 - MKV & AVCHD (Released)
Time

Unfortunately, I don't have a Blu-ray capture of TESB. Additionally, this method of restoring detail to clipped channels is painfully slow to render. At 1080p, it would take weeks to render an entire film. I had a stab at transferring the process to Harmy's Despecialized 2.0 but, because colour and gamma corrections have altered the original image data, it isn't possible.

Post
#615238
Topic
Info: New colormatching script
Time

You_Too said:

snicker said:

You_Too, this seems to be a fairly accurate translation of your reference colours.

I don't know, it looks quite off. The wall light is yellow for example.

Reds in both sources have lost subtle highlight detail due to clipping. I've found that once the Blu-ray colour clipping is dealt with, these yellow/orange highlight details show up quite often. They're exaggerated here but not inaccurate.

The hue translation through Photoshop's colour matching is pretty much spot on. If used as a hue adjustment layer for the output from g-force's script (which exhibits less clipping) it should produce quite good results, especially considering the limitations of both sources.

Post
#615177
Topic
Info: New colormatching script
Time

 

You_Too, I've modified the Blu-ray to remove most of the clipping from that frame. Would you mind running g-force's script on the following image? Should be a much better result. I've also included an untouched Blu-ray frame (bottom) if you feel like doing a comparison.

 

edit: added untouched (clipped) Blu-ray frame for comparison.

Post
#615174
Topic
Info: New colormatching script
Time

Gamma difference isn't the issue, You_Too. The 2004 SE (B reference) frame is massively clipped which is causing problems when redistributing the 97 SE RGB luma.

I've equalised the RGB luma in your A & B reference frames to illustrate the extent of the clipping in the 2004 SE. The only way this script might work with the 2004 SE/Blu-ray is if it's modified to affect hue only.

 

Post
#615037
Topic
Harmy's STAR WARS Despecialized Edition HD - V2.7 - MKV (Released)
Time

Thanks, You_Too. I remember reading about the experiments with ColorLike and the results being hit-and-miss. Disappointing, but as you say, there has to be someone out there with the skills to modify the script to compare frames in a video sequence and match individual RGB channels.

Did you test ColorLike with a raw Blu capture? If so, the Blu-ray clipping would play havoc with an automated process and maybe more so with one that operates on combined RGB. Did you notice whether scenes with minimal clipping produced better results? The Blu-ray colour clipping can be easily fixed to test if this is the case.

Another option would be to create an image sequence from the Blu-ray capture and colour match (a reference set) in Photoshop. Perhaps the colour matching algorithm used by Photoshop would offer up more consistent results.

 

Post
#615015
Topic
Harmy's STAR WARS Despecialized Edition HD - V2.7 - MKV (Released)
Time

AntcuFaalb said:

Harmy said:

No.

Damn! I was hoping you knew of some proprietary and/or commercial color-matching magic.

I've spent a lot of time searching for Windows-based software capable of histogram matching (video) and haven't had a lot of luck.

MatchGrade available for NukeX, Avid DS and Final Cut Pro seems very good but probably not much help to you unless you have a Mac.

If you search around the net, there are many interesting papers proposing methods for matching colours between (mostly) static images and I think if you had some scripting ability, and could also translate the math, you could achieve excellent results with video. More so in this case as you'd be matching frame-for-frame and the distribution of colour between the sources would be very similar even if the colours themselves are different.

Post
#612335
Topic
Harmy's STAR WARS Despecialized Edition HD - V2.7 - MKV (Released)
Time

The problem is that the contrast in the highlights has been compressed and they now appear somewhat flat. You can see that the specular highlights (which should have a noticeable edge) have merged with the surrounding highlights. Have a look also at the Stormtrooper's helmet, the bubble window below Threepio's shoulder, and the threading on his neck for further examples of loss of highlight detail. With selective channel replacement those specular highlights can be even better defined. Not trying to piss on anyone's work here, just pointing out something that stood out to me. The rest of it looks phenomenal.

Raw Blu-ray (top), Raw adjusted (middle), DE v2.1 (bottom)