Log in

View Full Version : Chromashift


juhok
17th December 2016, 23:10
Q1: Is there an easier way to kick chroma around?

sl = 0
sr = 2

chroma_u = core.std.ShufflePlanes(video, planes=[1], colorfamily=vs.GRAY)
chroma_u = core.std.CropRel(chroma_u, left=sl)
chroma_u = core.std.AddBorders(chroma_u, right=sl)
chroma_u = core.std.CropRel(chroma_u, right=sr)
chroma_u = core.std.AddBorders(chroma_u, left=sr)

chroma_v = core.std.ShufflePlanes(video, planes=[2], colorfamily=vs.GRAY)
chroma_v = core.std.CropRel(chroma_v, left=sl)
chroma_v = core.std.AddBorders(chroma_v, right=sl)
chroma_v = core.std.CropRel(chroma_v, right=sr)
chroma_v = core.std.AddBorders(chroma_v, left=sr)

video = core.std.ShufflePlanes(clips=[video, chroma_u, chroma_v], planes=[0, 0, 0], colorfamily=vs.YUV)

Q2: Does Resize with 'matrix, transfer, primaries' do the work of Colormatrix() nowdays? Couldn't find much up to date discussion about this (maybe it's too obvious).

Myrsloik
18th December 2016, 01:08
Q1:
Mildly inefficient since luma gets shifted too but much shorter:
sl = 0
sr = 2
video = core.std.ShufflePlanes(clips=[video, core.std.CropRel(video, left=sl, right=sr).std.AddBorders(right=sl, left=sl)], planes=[0, 1, 2], colorfamily=vs.YUV)
Just make your own collection of helper scripts if you need it often

Q2: Yes