View Full Version : Getting color settings to let a clip looks like another
spoRv
6th December 2016, 17:47
Confused title, I know, but here you are the explanation of what I'd like to find.
Let's say we have two clips; one is complete, but has "wrong" colors, the other is just a shot of the first one, but with "right" colors; is there a filter or script that could analize the difference between the two clips (obviously first trimmed to the same lenght of the second, spatially and temporally aligned) and get the needed settings for colors, brightness, contrast, to feed another filter like RGBadjust, coloryuv, coloryuv2 etc. so that "wrong" clip looks like the "right" one?
I'm aware that the rest of the second clip, apart the two shots that they have in common, with those settings applied, will be probably not as the second clip would look like, but it's a start.
Thanks for your help!
captaiŋadamo
6th December 2016, 17:52
http://forum.doom9.org/showthread.php?t=96308
spoRv
6th December 2016, 18:12
I'm aware of ColourLile filter, and I use it since a long time; it works very well, apart some artefacts.
But this will be useful just for the part in common for the two clips; what I need is something that will find the needed settings - and eventually apply them - to modify the first clip.
Let's say, wrong clip is too red, too low green, and lower brightness, so the eventual filter will give some values to lower the red, raises the green and brightness. Got the point?
raffriff42
6th December 2016, 23:27
Check out StainlessS' "Gamma Machine"
http://forum.doom9.org/showthread.php?t=173695
spoRv
7th December 2016, 00:22
I'd like to try it, but got the error: There is no function named 'RT_String'
StainlessS
7th December 2016, 01:02
You need RT_Stats, a few threads below this one at time of posting.
spoRv
7th December 2016, 02:23
Thanks StainlessS, you are helpful and kind, as usual.
Even if your script does not do what I was looking for, what I must say is, nothing short than... W-O-W-!!!
It make wonders... can't say more, you made a superb job!!!
Thanks again for all your works, keep continue to make us happy! :D
StainlessS
7th December 2016, 02:36
You can try GamMatch Demo.avs on your synced samples replacing this
# Some good color clip
#Avisource("F:\v\StarWars.AVI")
Avisource("1941 Flint Michigan Parade [Low, 360p].mp4.AVI")
ConvertToRGB24.KillAudio
DC=Last
# Simulate bad Input clip
RED=ShowRed(Pixel_Type="Y8").Levels( 0,0.8,255, 8,247,coring=false)
GRN=ShowGreen(Pixel_Type="Y8").Levels(0,1.5,255,12,223,coring=false)
BLU=ShowBlue(Pixel_Type="Y8").Levels( 0,2.0,255,32,239,coring=false)
MergeRGB(RED,GRN,BLU,pixel_Type="RGB24")
# Simulate DC Low res clip with good color
DC=DC.Blur(1.58).Blur(1.58).Spline36Resize(320,240) # Fake change of size for detect
O=Last
with this (untested), might also want to change x,y,w,h all to 0.
Avisource("BadColorClip.AVI").ConvertToRGB24
DC=Avisource("GoodColorClip.AVI").ConvertToRGB24
O=Last
spoRv
7th December 2016, 02:52
Tried, but "there is no function named 'GamMatch'
:(
StainlessS
7th December 2016, 02:56
Oh Yes There Is :) https://www.mediafire.com/#hb26mthbjz7z6
Last post in the GamMac thread:- http://forum.doom9.org/showthread.php?p=1784010#post1784010
spoRv
7th December 2016, 03:11
The mediafire links you posted doesn't work... I've downloaded it previously from here: http://www.mediafire.com/file/i43e1mji1y0a592/GamMatch_v0.02_dll_20161027.zip
Put the GamMatch.dll in the avisynth plugins directory, but nothing... tried with both this dll, and the one found on GamMac - I assumed they were both the same, as their size is the same, but tried both nevertheless...
StainlessS
7th December 2016, 03:35
The GamMac dll is 112 KB, GamMatch is 96KB, just downloaded from given link. :confused:
EDIT: And works fine here.
Reel.Deel
7th December 2016, 03:35
I wish this tool would be available for AviSynth: http://originaltrilogy.com/topic/Color-matching-and-prediction-color-correction-tool-v13-released/id/18128
I've never used it but I've heard many good things about it. The OriginalTrilogy forum has a lot of topics about color matching, even some AviSynth scripts, unfortunately I cannot find them at the moment.
spoRv
7th December 2016, 04:20
Control+C didn't work - discovered the C key is a bit faulty sometimes...
So, now it works, I tested it, and results are really promising!!! Thanks again for your work!
Now, back on topic, is there a way, for example, to feed GamMac with settings found with GamMatch, so the clip A (complete) with wrong colors will look like the clip B (incomplete) with right colors?
StainlessS
7th December 2016, 21:35
spoRv, I'm not ignoring you, just cant figure out a way to make that happen, still thinking about it though (dont hold your breath waiting).
spoRv
7th December 2016, 21:56
Don't worry, I'll wait patiently... :D
spoRv
8th December 2016, 10:02
I elaborated a bit my idea - hope that can give an avisynth guru here something to think about...
We have clip A, "wrong" colors (and/or gamma, and/or brightness, and/or contrast... wrong, at the end!), and clip B, "right" colors, but it's just a shot included in A; now, if we use ColourLike (or GamMatch, or MatchHistogram etc.) to get the A shot (just the bit equal to B), we have as a result clip C, which is the clip A with clip B colors.
To get to this result, data are stored/used somehow. Well, if we pick those data, and make an average, we *should* get some data that can be used to regrade clip A remaining parts to *try* to looks like clip B.
Of course, more reference clips we have, more the average settings will be near to the values that we could get if clip B will have the same frame numbers of clip A.
Practical use: clip A could be a movie, and clip B could be a trailer; we *know* clip B has supposedly the color grading/timing seen in theaters, and would like to see them applied to the whole movie. As clip B, the trailer, have a lot of brief shots, they could be used as reference - with the help of the user, of course, not automatically...
Like: clip B shot 1, is included in clip A scene 5; also, clip B shot 12 is included in clip A scene 5; what the filter should do is to match both shots (previously aligned by the user), and find average values to appy to clip A scene 5, to look like clip B shots; with use limited to only a scene, and not the whole movie, results could be good.
StainlessS
10th December 2016, 18:42
I wish this tool would be available for AviSynth: http://originaltrilogy.com/topic/Color-matching-and-prediction-color-correction-tool-v13-released/id/18128
I've never used it but I've heard many good things about it. The OriginalTrilogy forum has a lot of topics about color matching, even some AviSynth scripts, unfortunately I cannot find them at the moment.
Here is one Avisynth related thread on originaltrilogy.com
http://originaltrilogy.com/topic/different-approach-for-restore-bluray/id/17479
EDIT: and here, a bucket load more:- https://www.google.com/?gfe_rd=cr&ei=tAFqVuTzKdLS8AfknKK4BQ&gws_rd=ssl,cr&fg=1#q=Avisynth+color+OR+colour+site%3Aoriginaltrilogy.com
EDIT: Added the words color/colour to google search link above ie Google
Avisynth color OR colour site:originaltrilogy.com
EDIT: Here a web page on Google Search Operators:- https://support.google.com/websearch/answer/2466433?hl=en
jmac698
20th December 2016, 15:03
Hi,
I know exactly what the poster means, and I have worked on this problem before. It's not the same as colourlike, it's finding the settings of contrast, brightness, saturation, and tint which would best match two different frames, on average. I believe this has a real use, for example if I capture analog footage with different settings, now I can match the two sessions in a theoretically correct way.
To investigate that further, I tried different capture card settings on calibration footage and found that the capture controls were digital in nature, just multiplies and adds, so it's possible to do a theoretically optimal matching.
For colour tint it becomes a bit more complicated, as you have to do a rotation in the appropriate colour space. I derived the colour matrix formulas directly from the basic theories, such as whitepoint and whatever, so it would be as accurate as possible. Last I worked on it, I was able to come up with any of the rec values in a spreadsheet from first principles.
I have posted a simple script to do brightness/contrast matching in this way previously. Will have to search for it.
I haven't made a script for colour matching yet, and it would take me some work to derive all the formulas again.
Btw, during this I noticed that some other applications don't get it right, for example the colour vector displays in some plugins are wrong, the scaling in the axis are wrong. I posted about that as well, again I'd have to search.
This has a use in old analog mastering processes where colour differences were based on the same formulas, but perhaps implemented in an electronic analog form. I'm not sure how colour grading analog circuits operated, but one could derive a model for those as well. What this would mean is you'd have a more constrained theory to change colour grading.
jmac698
20th December 2016, 15:51
Found it, it's called FindTweak
http://forum.doom9.org/showthread.php?t=161960
and a discussion of the problem, with links to trilogy thread, yes this comes up a lot :)
http://forum.doom9.org/showthread.php?t=162460
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.