Hello all,
I need to make an explanation of color difference signals in YUV.
I'm sure you can do this simply in AviSynth but I'm struggling to work it out, I want to just extract Y (so essentially mono) which is easy enough but can you just generate the Chroma portion as output by AviSynth?
It doesn't have to be astonishingly accurate, it's only for visual conceptualization.
Thanks,
Ben
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
Great thank you, maybe my question is malformed but you can extract a color representation? This shows the channel in mono (which is expected.)
Something like the image here?
https://upload.wikimedia.org/wikipedia/commons/2/29/Barn-yuv.png -
Yes, that's easy.
For U:
Code:Y=Levels(0,1,255, 128,128, false) U=UtoY() V=Grayscale().VtoY() YToUV(U, V, Y)
For V:
Code:Y=Levels(0,1,255, 128,128, false) U=Grayscale().UtoY() V=VtoY() YToUV(U, V, Y)
-
Note first that you can't "see" U or V. Any way of visualizing them is in some way artificial. What Skiller is doing is displaying the U or V channel with the other channels mapped to 128 (medium grey for the luma, grey for the other chroma channel). Skiller's U and V channels don't look the same as the wikipedia image because the wikipedia image isn't showing U and V that way but some other convolution. A slight modification of Skiller's conversions (the end result is the same):
Code:function ShowU(clip c) { Y=ColorYUV(c, cont_y=-256) U=UtoY(c) V=Y YToUV(U, V, Y) } function ShowV(clip c) { Y=ColorYUV(c, cont_y=-256) U=Y V=VtoY(c) YToUV(U, V, Y) } ImageSource("Barn-yuv.png", start=0, end=23, fps=23.976) Crop(0, height/4*0, -0, height/4) # just the top part ConvertToYV24() # so Y, U, and V all have the same dimensions StackVertical(last, GreyScale().Subtitle("Y"), ShowU().Subtitle("U"), ShowV().Subtitle("V"))
[Attachment 70983 - Click to enlarge] -
Thank you both, and @jagabo thank you for taking the time to help me with this.
Totally understand with regards to it being artificial, I get that entirely but I was struggling to produce a concept for a non expert audience.
Thanks again, that is very kind.
Ben -
I don't know exactly what the Wikipedia image is show as U and V but I worked out something that looks similar:
Code:function ShowUAsBlueGreen(clip c) { c ShowU().Tweak(hue=-22).ColorYUV(off_u=22, off_v=-55) YtoUV(UtoY(), VtoY(), c.VtoY().ColorYUV(cont_y=-128, off_y=-40)) } function ShowVAsRedYellow(clip c) { c Showv().Tweak(hue=10).ColorYUV(off_u=-55, off_v=10) YtoUV(UtoY(), VtoY(), c.UtoY().ColorYUV(cont_y=-212, off_y=-16)) }
[Attachment 71249 - Click to enlarge]Last edited by jagabo; 26th May 2023 at 19:08.
Similar Threads
-
Avidemux 2.8.0 colorspace
By tugatomsk in forum Video ConversionReplies: 5Last Post: 5th Apr 2022, 16:15 -
Colorspace conversion
By Sharc in forum Video ConversionReplies: 8Last Post: 1st May 2020, 09:39 -
Converting Blu-Ray YUV to RGB and back to YUV?
By killerteengohan in forum RestorationReplies: 17Last Post: 17th Mar 2020, 20:42 -
ffmpeg yuv colorspace is BT.601 or BT.709?
By colibri in forum Newbie / General discussionsReplies: 13Last Post: 22nd Dec 2019, 01:00 -
Screenshots and respect of the YUV>RGB colorspace conversion
By abolibibelot in forum Video ConversionReplies: 15Last Post: 3rd Nov 2018, 17:37