Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
27th November 2019, 22:06 | #1 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
ColourWarp - smooth manual remapping of UV colours for colour correction
ColourWarp v0.1 ColourWarp is a filter I've quickly knocked up to remap the colours of YUV video. It's not highly optimised or anything and may have bugs (although I haven't found any yet). It only works on 8-bit YUV video at the moment, and it only remaps the UV channels. If there's any interest, I might update it to full YUV remapping but I'm not sure how useful that would be. Colours are remapped by specifying control point pairs of UV values: Code:
ColourWarp(clip, 0,0, -64,-64) # a single pair will shift the colours ColourWarp(clip, 0,0, 0,0, 64,64, 32,32) # two pairs will scale/rotate (this example will reduce saturation of all colours - it fixes grey to grey and then scales 64,64 down to 32,32) ColourWarp(clip, 0,0, 0,0, 0,128, 0,0, -128,-128, -128,-128, 128,-128, 128,-128, -128,128, -128,128, 128,128, 128,128) # this example fixes all the corners, and center, of the UV square, but remaps U=0,V=128 to U=0,V=0 (grey) You can also specify up to two additional clips (if only one clip is specified, the input clip is assumed to the first "extra" clip). These two clips act as sources for you to pick specific pixels (any number parameters that come after the pixel source clips) to be remapped: Code:
ColourWarp(clip, 0,0, 0,0, clip1, clip2, 0,100,150, 10,200,250) # this example fixes grey to grey (the first four numbers), # then maps the colour of pixel [100,150] from clip1, frame 0 to # the colour of pixel [200,250] from clip2, frame 10) I hate writing documentation and to be honest I'm already pretty bored of writing this post, but I'm better at answering questions, so ask away. Last edited by wonkey_monkey; 27th November 2019 at 23:25. |
27th November 2019, 22:41 | #2 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
__________________
See My Avisynth Stuff |
|
27th November 2019, 23:26 | #4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
No excuses, get the source up, you know how short temptered Real.Finder is.
EDIT: Please.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 28th November 2019 at 09:15. |
28th November 2019, 13:15 | #6 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
You need to specify a set of pixels to be mapped between - it isn't automatic. If the two clips are already aligned, you could pick points at random, but you're probably better off picking a few with high saturation, widely space around the UV square, plus one grey point.
Code:
clip1.ColourWarp(clip2,\ f11,x11,y11, f21,x21,y21,\ f12,x12,y12, f22,x22,y22,\ f13,x13,y13, f23,x23,y23\ ) I suppose I could add a mode which automatically finds the most saturated pixels (again, assuming the clips are already aligned, which isn't the case for the clips I wrote this for). Last edited by wonkey_monkey; 28th November 2019 at 14:18. |
28th November 2019, 17:56 | #7 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
|
|
28th November 2019, 18:20 | #8 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
http://avisynth.nl/index.php/Merge#MergeChroma |
|
28th November 2019, 18:34 | #9 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
|
|
28th November 2019, 21:11 | #10 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
You don't need to do it for every frame. You can select pixels from just a single pair of frames, if they've got enough colours to give you a decent map. Or no frames at all, by giving it direct UV values as inputs. As for using mergechroma, this isn't always the best solution even if you can align your clips. Your target might be lower resolution, or noisy, or just not have the same vibrancy and range of colours to begin with. Last edited by wonkey_monkey; 28th November 2019 at 21:16. |
|
28th November 2019, 21:36 | #11 | Link |
Registered User
Join Date: Mar 2018
Posts: 447
|
I've had good results with MatchHistogram, or rather the VapourSynth port of it. It does require that the frames are aligned so it may not work in your case. In the VS version you can calculate the histogram from two clips and apply the histogram to a third clip, this way you can match the colors of specific part of the frames and apply them to the whole frame, for example.
|
28th November 2019, 23:08 | #12 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
|
|
|
|