26.01.2026, 21:41 (This post was last modified: 26.01.2026, 21:41 by Selur.)
Now that I think about it,.. at the moment Hybrid would add black borders,.. which will cause problems when Retinex is used.
Problem is that you are using YUV color space in your scripts and seemingly don't use 4:4:4 color sampling,... (mod2 usually is required for 4:2:0 or 4:1:1)
Will be afk. tomorrow, but I'll think about an option for Hybrid to use https://github.com/dubhater/vapoursynth-fillborders instead of addborders, which should work with Retinex.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
I've got an issue with a cheap super 8mm film scanner that on certain scenes sets the auto white balance so that there is a horrific blue cast across the entire frame. It's scene dependent and no way to disable it in the firmware (unless its de compiled and reverse engineered). It's so bad on some scenes that I can't correct it. The best I've found at correcting it is deoldify, except of course it treats it as though there is no colour information at all, so what is there is lost. I've tried to merge the original and deoldified frames with limited success.
I cannot find a function within deoldify to attempt to restore badly calibrated frames as opposed to colouring b&w. does anybody know of a way I can achieve this?
This is what i have currently with an example of the worst scenes.
The above is not too bad considering, but when compared with another scene from the same scan, we lose a lot of what was good. of course this frame doesn't actually need anything done at all, but that's where I would like to get back to.
I'm sure is there a much better method to remove the blue cast, but I'm unable to land on a method of white balancing across the entire film scan that resolves the worst parts, and 90% of the scan only needs a simple adjustment.
(5 hours ago)domb84 Wrote: I'm sure is there a much better method to remove the blue cast, but I'm unable to land on a method of white balancing across the entire film scan that resolves the worst parts, and 90% of the scan only needs a simple adjustment.
Any help appreciated!
In Hybrid there is the filter "Auto white" (see picture)
You should apply it to the orginal clip before merging the clip with the HAVC colored clip.
Otherwise you can try the Example 6: Direct application of filter B&W tune with some colors final adjustment
You can find it at page 114 of HAVC User Guide.
Try to play with the parameters strength and gamma of function HAVC_adjust_rgb().
I'm using native vapoursynth rather than hybrid but I'm already using grayworld to perform a whitebalance that removes the cast before merging. of course the destroyed skintones still remain which the merge doesn't do enough to resolve, but also takes out the colour that remains.
Sure here's an "uncompressed" sample. I have no idea what is throwing the white balance across these scenes but you can see how severe it is in the cut.
Here's the vs script. I saw some information regarding Softlight, but I cannot understand from the docs how to utilise that to eliminate the colour cast.
# Imports
import vapoursynth as vs
from vapoursynth import core
# loading plugins
import havsfunc as haf
import lostfunc as lof
import muvsfunc as muf
import CropResize as cr
import adjust
import G41Fun
import adjust
import vsdeoldify as havc
import vs_colorfix
# source
src = r"xxx.MP4"
# Load source
src = core.ffms2.Source(source=src)
src = core.std.AssumeFPS(src, fpsnum=18, fpsden=1)
# convert to YUV
src = core.resize.Bicubic(src, 1440, 1080, format=vs.YUV444P16, matrix_in_s="709")
# make a new source
clip = src
### deoldify ###
# changing range from limited to full range for HAVC
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_s="full")
# DeOldify only model
color = havc.HAVC_colorizer(clip, method=0)
#
# merge
clip = core.fmtc.bitdepth (clip, bits=32)
clip = core.grwrld.grayworld(clip)
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_s="full")
clip = core.std.Merge(color,clip,weight=[0.33,0.33,0.33])
# retinex or grayworld
#clip = core.retinex.MSRCP(clip)