Log in

View Full Version : Emulate the "Red" from Component?


zerowalker
20th December 2013, 15:35
Is it possible to somehow Emulate the Red component cable in a video afterwards?

Of course i know it canīt be perfect by any means, and i really doubt itīs even possible.

But would like to try if it is.

As you may guess, the "Red" cable, gives the color Red, so everything is Green/Blueish, which makes me doubt you can even guess the Red color, but perhaps a setting as i know what should be red my work.

Thanks

poisondeathray
20th December 2013, 16:00
Is it possible to somehow Emulate the Red component cable in a video afterwards?

Of course i know it canīt be perfect by any means, and i really doubt itīs even possible.

But would like to try if it is.

As you may guess, the "Red" cable, gives the color Red, so everything is Green/Blueish, which makes me doubt you can even guess the Red color, but perhaps a setting as i know what should be red my work.

Thanks


It's not RGB - In component video YPbPr, The luma is separated from the color difference channels by the "green" cable

The "red" cable, or Pr digitized equivalent is Cr (from Y'CbCr) , or "V" in "YUV" notation

In avisynth, the greyscale representation of "V" will be shown by VtoY()

If you want the Red channel in RGB , from an RGB source, shown in greyscale values use ShowRed()

zerowalker
20th December 2013, 17:10
Oh, knew it was component, but thought Red brought the Color Red, cause thatīs the only color which is missing, or atleast i canīt See the Red.

So there isnīt a way to, try to push red onto it?

martin53
20th December 2013, 17:50
You might do these experiments:
- If it is RGB
MergeRGB(ShowGreen().ConvertToY8(matrix=(width>1100 || height>600)?"PC.709":"PC.601").Levels(0,1.3,255,0,255), ShowGreen(), ShowBlue())
This takes green as overall luma, assumes that red was identical to luma but gives it a higher gamma, so moderate brightness does look more brown than green, while white is reproduced OK.

- If it is YUV
Depends on the V component of the bad clip. If it is ~16 you might check ColorYUV(off_v=112)

EDIT: Needed so long for this post that you were faster. You can still convert from YUV to RGB to try the first plaster.

raffriff42
20th December 2013, 17:58
>So there isnīt a way to, try to push red onto it?
If the red channel is completely missing, probably not. But let's take a look.
Could you please post a screenshot showing the problem, and if possible, the correct image?

zerowalker
21st December 2013, 15:11
Here is a clip: http://www.sendspace.com/file/58y8ru

Itīs not super important as itīs just a random game capture of some sort.
But it would be interesting to see what can be done to it.


The Arrow buttons are supposed to be Yellow, The hearts are supposed to be Red, this may be used as a guide line as the rest are more "greenish" colors at default.

martin53
21st December 2013, 15:22
Use 'Greyscale()' and claim it's a piece of art :devil:

raffriff42
21st December 2013, 16:12
Here is a clip87 MB: that's a big screenshot :devil:
I get my Internet by carrier pigeon (http://www.ietf.org/rfc/rfc1149.txt) so this may take a while...

zerowalker
21st December 2013, 16:50
@martin53, good one XD

@raffriff42, oh well i took a video, want me to take a pic instead or have you gotten it down?

raffriff42
21st December 2013, 18:19
Actually it's good you posted a video. Here's a first take.

Before:
https://www.dropbox.com/s/m79qwygq3kourmo/Non-Red%20Component%20Capture~orig.jpg?raw=1

After:
https://www.dropbox.com/s/n36zlk7vuacrn46/Non-Red%20Component%20Capture~fix1.jpg?raw=1#avisynth
#
AviSource("Non-Red Component Capture.avi")
#Info ## 720x480, YUY2

/*
## step 1: check R, G, B
ConvertToRGB32
return Interleave(
\ ShowRed.ConvertToY8.Histogram.Subtitle("R", align=8),
\ ShowGreen.ConvertToY8.Histogram.Subtitle("G", align=8),
\ ShowBlue.ConvertToY8.Histogram.Subtitle("B", align=8)
\)
## ...looks OK
*/

/*
## step 2: check Y, U, V
ConvertToYV12
return Interleave(
\ ConvertToY8.Histogram.Subtitle("Y", align=8),
\ UtoY.ConvertToY8.PointResize(Width, Height).Histogram.Subtitle("U", align=8),
\ VtoY.ConvertToY8.PointResize(Width, Height).Histogram.Subtitle("V", align=8)
\)
## ...V channel *almost* entirely missing
*/

/*
## step 3: attempt to fix
ConvertToYV12
return ColorYUV(cont_v=8000) #.Histogram(mode="levels")
## ... V channel extremely noisy, due to high amplification
*/

## step 4: attempt a better fix
ColorYUV(cont_v=8000, off_u=10, off_v=-15)

YToUV(
\ UtoY.ConvertToY8,
\ VtoY
\ .TemporalSoften(3, 255, 255, 255)
\ .SpatialSoften(5, 255, 255)
\ .ConvertToY8,
\ ConvertToY8
\)
Tweak(hue=30)
#Histogram(mode="levels")
#


Second take:
https://www.dropbox.com/s/m543cahz8ba6yas/Non-Red%20Component%20Capture~fix2.jpg?raw=1#avisynth

AviSource("Non-Red Component Capture.avi")

ColorYUV(cont_v=8000)

YToUV(
\ UtoY.ConvertToY8,
\ VtoY
\ .TemporalSoften(3, 255, 255, 255)
\ .SpatialSoften(5, 255, 255)
\ .ConvertToY8,
\ ConvertToY8
\)

ConvertToRGB32
MergeRGB(
\ ShowRed.Levels(0, 1.0, 226, 0, 255, coring=false),
\ ShowGreen.Levels(0, 1.0, 190, 0, 255, coring=false),
\ ShowBlue.Levels(0, 1.0, 150, 0, 255, coring=false)
\)
ConvertToYV12
Tweak(hue=30)
#

zerowalker
21st December 2013, 21:03
raffriff, Interesting results.
It looks closer, especially the second, will try to play around as well.


EDIT:

Here is my result, pretty close to yours just a slight difference.

ColorYUV(cont_v=8000)

YToUV(
\ UtoY.ConvertToY8,
\ VtoY
\ .TemporalSoften(3, 255, 255, 255)
\ .SpatialSoften(5, 255, 255)
\ .ConvertToY8,
\ ConvertToY8
\)

ConvertToRGB32
MergeRGB(
\ ShowRed.Levels(0, 0.5, 155, 00, 255, coring=true),
\ ShowGreen.Levels(0, 1.0, 170, 0, 255, coring=true),
\ ShowBlue.Levels(0, 1.0, 190, 0, 255, coring=true)
\)
ConvertToYV12
Tweak(hue=55,sat=1.5)
#

It seems itīs impossible to make it work out , which isnīt weird as there is no way for it to know what Not yo touch when changing the color levels.
But overall, it seems like you can slightly emulate the feeling that the Red is there to improve the result compared to a lonely Green/Blue world.

http://i41.tinypic.com/2rw21rs.png


Well i think there is not much more that can be done, especially not in a Video compared to a single screenshot.

Thanks!