VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. So I got the recent Terror-Vision Blu-Ray of Dante's Inferno that came with the original red tint version of the film. The quality isn't great, though, and the Italian DVD is way better, but it doesn't have the red tint. Is there a way I could add a custom color filter to the Italian DVD in avisynth to give it the red tint?

    This is what the red tint version looks like:
    Image
    [Attachment 78959 - Click to enlarge]

    Image
    [Attachment 78960 - Click to enlarge]

    Image
    [Attachment 78961 - Click to enlarge]


    This is my DVDRIP of the regular tinted version:
    Image
    [Attachment 78962 - Click to enlarge]

    Image
    [Attachment 78963 - Click to enlarge]

    Image
    [Attachment 78964 - Click to enlarge]


    What script should I use to give the DVD version the red tint? I also don't want the floating black bars to be red, but I'm guessing that might be inevitable to a degree.
    Quote Quote  
  2. Probably easiest way will be read Cb and Cr values of tint (should be constant) from red tint source and later set fixed value for whole Cb and Cr correspondingly to red tint source values - my assumption is - source is black&white (grayscale) so only Y channel carry information, Cb and Cr normally for grayscale video should be equal to Cb=128, Cr=128 - in case of red tint Cb and Cr should have constant value different than 128.
    Quote Quote  
  3. Originally Posted by pandy View Post
    Probably easiest way will be read Cb and Cr values of tint (should be constant) from red tint source and later set fixed value for whole Cb and Cr correspondingly to red tint source values - my assumption is - source is black&white (grayscale) so only Y channel carry information, Cb and Cr normally for grayscale video should be equal to Cb=128, Cr=128 - in case of red tint Cb and Cr should have constant value different than 128.
    What are the exact steps to get CBR info from the red tint and the script I would use? I've never played with color before like this, so it's all new to me.
    Quote Quote  
  4. Bellow example shows YUV statistics, as input i've used one of your pictures.

    Code:
    ffprobe -f lavfi movie=sz15pq.png,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YHIGH,lavfi.signalstats.YAVG,lavfi.signalstats.YLOW,lavfi.signalstats.YMIN,lavfi.signalstats.UMAX,lavfi.signalstats.UHIGH,lavfi.signalstats.UAVG,lavfi.signalstats.ULOW,lavfi.signalstats.UMIN,lavfi.signalstats.VMAX,lavfi.signalstats.VHIGH,lavfi.signalstats.VAVG,lavfi.signalstats.VLOW,lavfi.signalstats.VMIN
    and stats looks like this:

    Code:
    TAG:lavfi.signalstats.YMIN=18
    TAG:lavfi.signalstats.YLOW=31
    TAG:lavfi.signalstats.YAVG=59.626
    TAG:lavfi.signalstats.YHIGH=91
    TAG:lavfi.signalstats.YMAX=132
    TAG:lavfi.signalstats.UMIN=106
    TAG:lavfi.signalstats.ULOW=114
    TAG:lavfi.signalstats.UAVG=119.413
    TAG:lavfi.signalstats.UHIGH=124
    TAG:lavfi.signalstats.UMAX=128
    TAG:lavfi.signalstats.VMIN=131
    TAG:lavfi.signalstats.VLOW=144
    TAG:lavfi.signalstats.VAVG=165.206
    TAG:lavfi.signalstats.VHIGH=189
    TAG:lavfi.signalstats.VMAX=203
    So based on this i would try to use for U (Cb) channel constant value 114 and for V (Cr) constant value 189.
    Quote Quote  
  5. Originally Posted by pandy View Post
    Bellow example shows YUV statistics, as input i've used one of your pictures.

    Code:
    ffprobe -f lavfi movie=sz15pq.png,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YHIGH,lavfi.signalstats.YAVG,lavfi.signalstats.YLOW,lavfi.signalstats.YMIN,lavfi.signalstats.UMAX,lavfi.signalstats.UHIGH,lavfi.signalstats.UAVG,lavfi.signalstats.ULOW,lavfi.signalstats.UMIN,lavfi.signalstats.VMAX,lavfi.signalstats.VHIGH,lavfi.signalstats.VAVG,lavfi.signalstats.VLOW,lavfi.signalstats.VMIN
    and stats looks like this:

    Code:
    TAG:lavfi.signalstats.YMIN=18
    TAG:lavfi.signalstats.YLOW=31
    TAG:lavfi.signalstats.YAVG=59.626
    TAG:lavfi.signalstats.YHIGH=91
    TAG:lavfi.signalstats.YMAX=132
    TAG:lavfi.signalstats.UMIN=106
    TAG:lavfi.signalstats.ULOW=114
    TAG:lavfi.signalstats.UAVG=119.413
    TAG:lavfi.signalstats.UHIGH=124
    TAG:lavfi.signalstats.UMAX=128
    TAG:lavfi.signalstats.VMIN=131
    TAG:lavfi.signalstats.VLOW=144
    TAG:lavfi.signalstats.VAVG=165.206
    TAG:lavfi.signalstats.VHIGH=189
    TAG:lavfi.signalstats.VMAX=203
    So based on this i would try to use for U (Cb) channel constant value 114 and for V (Cr) constant value 189.
    What filter do I use for cb and cr, and what's the exact line I would enter in Avisynth?
    Quote Quote  
  6. Your DVD pics are already resized to 766x576. Why?
    Anyway, I'd first make a picture in the correct tint at the size you want (720x576, I assume). Using CSamp, I got R=200, G=47,B=63, although those values vary depending on exactly where you take the readings. Then use this script to greyscale your DVD followed by tinting it. Adjust the opacity to suit. Do some brightening and contrasting when done, to suit what you want.

    A=Last.Tweak(Sat=0,Coring=False)
    Mask=ImageSource("Tint.png")
    Overlay(A,B,0,0,Mask,Greymask=False,Opacity=1.0)
    Letterbox(0,0,4,4)
    Tweak(Bright=-55,Cont=1.5,Coring=False)


    If you like, you can add back the black bars using the Letterbox command. Enclosing CSamp, in case you want to use it to try and get the tint color.
    Image Attached Files
    Quote Quote  
  7. It was many years ago since i've used Avisynth so i can only suggest how i would perform processing:

    - split your input source on 3 planes, Y, U, V, ( https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/extract.html ?)
    - apply separately to U and V plane Limiter so signal values will be clamped to defined range ( https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/limiter.html )
    - combine modified U and V planes with unaltered Y plane ( https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/merge.html ?)

    This is probably fastest method.
    Quote Quote  
  8. Originally Posted by manono View Post
    Your DVD pics are already resized to 766x576. Why?
    Anyway, I'd first make a picture in the correct tint at the size you want (720x576, I assume). Using CSamp, I got R=200, G=47,B=63, although those values vary depending on exactly where you take the readings. Then use this script to greyscale your DVD followed by tinting it. Adjust the opacity to suit. Do some brightening and contrasting when done, to suit what you want.

    A=Last.Tweak(Sat=0,Coring=False)
    Mask=ImageSource("Tint.png")
    Overlay(A,B,0,0,Mask,Greymask=False,Opacity=1.0)
    Letterbox(0,0,4,4)
    Tweak(Bright=-55,Cont=1.5,Coring=False)


    If you like, you can add back the black bars using the Letterbox command. Enclosing CSamp, in case you want to use it to try and get the tint color.
    I'm making an anamorphic x264 rip with MEGUI, so the SAR will be 16:15. Since I'm using AviSynth+ x64, I had to use CoronaSequence to load the image. This was my script:

    A=Last.Tweak(Sat=0,Coring=False)
    Mask=CoronaSequence("C:\Users\zacha\Pictures\Tint. png")
    Overlay(A,B,0,0,Mask,Greymask=False,Opacity=1.0)
    Letterbox(0,0,4,4)
    Tweak(Bright=-55,Cont=1.5,Coring=False)

    And I got this error:
    Image
    [Attachment 78976 - Click to enlarge]
    Quote Quote  
  9. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    As well you should. Where did clip B (2nd item in overlay) come from? It's not referenced.


    Scott
    Quote Quote  
  10. I don't know if I'm under-thinking it, but you can adjust color using RGB values with the HDRMatrix plugin from here: http://videoartifact.com/hdr/

    I converted a color video to black and white and fiddled with it until it looked similar to one of your screenshots.
    You mightn't need to use Tweak to adjust the contrast and brightness etc, or you might only need to adjust them a little. I mainly added it to make the picture look like your DVD. If you increase red while decreasing blue and green, you might find a happy balance that doesn't change the over-all brightness. If you only increase red while leaving blue and green at 1.0 instead of reducing them, it'll probably end up too bright and saturated.

    GreyScale()
    Matrix(rg=1.2, gg=0.45, bg=0.5, bitdepth=8)
    Tweak(Bright=20, Sat=0.7, Cont=0.5, Coring=false)

    Image
    [Attachment 78977 - Click to enlarge]
    Last edited by hello_hello; 9th May 2024 at 19:12.
    Quote Quote  
  11. Originally Posted by hello_hello View Post
    I don't know if I'm under-thinking it, but you can adjust color using RGB values with the HDRMatrix plugin from here: http://videoartifact.com/hdr/

    I just converted a color video to black and white and fiddled with it until it looked similar to one of your screenshots.

    GreyScale()
    Matrix(rg=1.2, gg=0.45, bg=0.5, bitdepth=8)
    Tweak(Bright=20, Sat=0.7, Cont=0.5, Coring=false)

    Image
    [Attachment 78977 - Click to enlarge]
    Thanks! This worked perfectly! I increased the brightness to 25, and that looked best.

    Now, if I wanted to take the full DVDR and "redscale" it, how would I do that?
    Quote Quote  
  12. Originally Posted by ZacharyGeorgeNN View Post
    Thanks! This worked perfectly! I increased the brightness to 25, and that looked best.
    I added a thought to my post regarding decreasing blue and green so there's no need to use Tweak to adjust the brightness much, but whatever works.

    Originally Posted by ZacharyGeorgeNN View Post
    Now, if I wanted to take the full DVDR and "redscale" it, how would I do that?
    I'm not sure what you mean. Can't you apply the same adjustment to to the whole DVD, or are you referring to something else?
    Quote Quote  
  13. I apologize. I left out a line, the one that defines B:

    A=Last.Tweak(Sat=0,Coring=False)
    Mask=ImageSource("Tint.png")
    B=Mask
    Overlay(A,B,0,0,Mask,Greymask=False,Opacity=1.0)
    Letterbox(0,0,4,4)
    Tweak(Bright=-55,Cont=1.5,Coring=False)


    And it looks like you have it already, thanks to hello_hello's help, and that's what counts.
    Quote Quote  
  14. Originally Posted by ZacharyGeorgeNN View Post

    Originally Posted by hello_hello View Post
    GreyScale()
    Thanks! This worked perfectly! I increased the brightness to 25, and that looked best.
    Conversion from YCbCr to Y may introduce issues - it is more safe to extract Y channel from source and later convert it to RGB to apply proposed by hello_hello colorization. My goal would be to keep Y unaltered but if you are happy by modifying it then fine.
    Quote Quote  
  15. GreyScale() doesn't convert to Y though. It just sets the values for the U and V planes to 128 (grey). Unless I'm misunderstanding what you mean.

    I don't know what math the HDRMatrix plugin does to convert it's RGB arguments to YUV values, or if it changes the values for Y in the process, but I did play around a little doing it this way...

    Source

    Image
    [Attachment 79014 - Click to enlarge]


    GreyScale()

    Image
    [Attachment 79015 - Click to enlarge]


    Best as I could work out, this converts GreyScale to RedScale.

    GreyScale()
    ColorYUV(off_u=-38, off_v=112)

    Image
    [Attachment 79016 - Click to enlarge]


    It obviously needs a fair reduction in saturation, and you can fiddle with the U and V values to change the hue, but I assume the Y plain would remain unaltered unless you told Tweak to adjust the brightness or contrast.

    GreyScale()
    ColorYUV(off_u=-38, off_v=112)
    Tweak(Sat=0.4, Coring=False)

    Image
    [Attachment 79017 - Click to enlarge]
    Last edited by hello_hello; 11th May 2024 at 04:49.
    Quote Quote  
  16. Originally Posted by hello_hello View Post
    GreyScale() doesn't convert to Y though. It just sets the values for the U and V planes to 128 (grey). Unless I'm misunderstanding what you mean
    I overlooked information about Grayscale() behavior in case of the YUV - it works in such case similarly to ShowY() - my fault, you was OK. Sorry.
    Quote Quote  
  17. Maybe something like this:

    Code:
    grey = GreyScale()
    red = grey.ColorYUV(off_u=-38, off_v=112)
    ymask=grey.ColorYUV(gain_y=-50, off_y=-10).mt_lut("x 128 - abs 2 *", chroma="-128")
    Overlay(red, grey, mode="blend", mask=ymask)
    The "red" stream is almost all illegal combinations of Y, U, and V. Desaturating the darks and lights legalizes most of them

    Image
    [Attachment 79032 - Click to enlarge]


    Or for pure red scale:
    Code:
    GreyScale()
    RGBAdjust(r=1.5, g=0, b=0))
    Image
    [Attachment 79033 - Click to enlarge]
    Last edited by jagabo; 11th May 2024 at 18:40.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!