Log in

View Full Version : Best overlay with film grain?


color
3rd April 2023, 12:24
https://resolver.tools/product/16mm-4k-uhd-film-grain-in-29-97-prores-10-second-loop/

I found this one, but I can not get it to look good maybe "overlay" is not the right way?

I use this, but it does not look good. Most mode just make it light or dark and does not look "natural grainy"

A=LWLibavVideoSource("movie.mp4")
B=LWLibavVideoSource("UHD_16mm_GRAIN_2997_PR422.mov").Loop()

Overlay(A, B, Y=0, X=0, mode="blend", opacity=0.50)
Levels(50, 1.00, 255, 0, 255, coring=true)

poisondeathray
3rd April 2023, 14:34
It also depends on the look you are going for, and the source clip

You have to play with the blend modes and opacity. A commonly used blend mode for grain plates is "linear light." It's not featured in the standard Overlay. I think Overlay_MTools and OverlayPlus have it

color
3rd April 2023, 17:18
It also depends on the look you are going for, and the source clip

You have to play with the blend modes and opacity. A commonly used blend mode for grain plates is "linear light." It's not featured in the standard Overlay. I think Overlay_MTools and OverlayPlus have it


OverlayPlus(A, B, Y=0, X=0, mode="linearlight", opacity=0.50)

looks great. Thank you. I didn't think Linear Light exited. :thanks:

color
3rd April 2023, 17:23
But I use opacity= 0.00 and gets this top image. Don't know why it shows when 0.00?

https://i.ibb.co/mFF5nRg/alogo00.png

when using opacity= 1.00 i get this:

https://i.ibb.co/K5Tf4zN/alogo10.png

poisondeathray
3rd April 2023, 17:34
But I use opacity= 0.00 and gets this top image. Don't know why it shows when 0.00?

opacity = 0, chroma=false vs. true


chroma:
-------
Enable or disable chroma processing. When chroma=false, chroma planes are copied from the base clip.
Dafault: false (for RGB all planes are always processed)

color
3rd April 2023, 17:46
opacity = 0, chroma=false vs. true

Nope, same with

mode="linearlight", opacity=0, chroma=true

mode="linearlight", opacity=0, chroma=false

poisondeathray
3rd April 2023, 17:46
Nope, same with

mode="linearlight", opacity=0, chroma=true

mode="linearlight", opacity=0, chroma=false

Are you using current version of OverlayPlus ? I get different results for chroma false vs true with opacity=0. False returns the BG

I'm using OverlayPlus v1.3.0 (2022/10/24)


bg=blankclip(length=1000, width=3840,height=2160, pixel_type="YUV422P10", colors=[240,512,512])
g=LSmashVideoSource("UHD_16mm_GRAIN_2997_PR422.mov").loop(10).trim(0,999)
overlayplus(bg, g, mode="linearlight", chroma=false, opacity=0)
#overlayplus(bg, g, mode="linearlight", chroma=true, opacity=0)




You can also look at dogway's ex_blend . For linearlight I get ~10-20% faster for YUV422P10 . His benchmarks say 1% for multiply, but different system, pixel types etc... YMMV


### 100% ex_blend (a, mode="multiply")
### 99% OverlayPlus(a, mode="multiply",chroma=false) # only in PC range
### 92% Overlay_MTools(mode="multiply") # only in PC range
### 56% Overlay (mode="multiply") # only in PC range


#overlayplus(bg,g, mode="linearlight", chroma=false, opacity=0.5)
#ex_blend(bg,g, mode="linearlight", opacity=0.5)

Reel.Deel
3rd April 2023, 18:30
I get different results for chroma false vs true with opacity=0. False returns the BG


I'll take a look later on today.

color
3rd April 2023, 18:50
Are you using current version of OverlayPlus ? I get different results for chroma false vs true with opacity=0. False returns the BG

I'm using OverlayPlus v1.3.0 (2022/10/24)


bg=blankclip(length=1000, width=3840,height=2160, pixel_type="YUV422P10", colors=[240,512,512])
g=LSmashVideoSource("UHD_16mm_GRAIN_2997_PR422.mov").loop(10).trim(0,999)
overlayplus(bg, g, mode="linearlight", chroma=false, opacity=0)
#overlayplus(bg, g, mode="linearlight", chroma=true, opacity=0)


You can also look at dogway's ex_blend . For linearlight I get ~10-20% faster for YUV422P10 . His benchmarks say 1% for multiply, but different system, pixel types etc... YMMV

#overlayplus(bg,g, mode="linearlight", chroma=false, opacity=0.5)
#ex_blend(bg,g, mode="linearlight", opacity=0.5)

Yes I am using the latest, just downloaded it from github so its the latest.

I'll take a look later on today.

Oh!, I just realized, I used "ConvertToRGB()" then it does not work, but when I change to "ConvertToYV12()" it works perfectly.

poisondeathray
3rd April 2023, 18:57
IMO, the way it should work - opacity=0 should always return the BG, regardless of settings, or pixel format, or mask. My reasoning is the overlay layer is "on top" of the BG layer. At "zero" opacity, there is no overlay - only the BG remains

color
4th April 2023, 08:19
IMO, the way it should work - opacity=0 should always return the BG, regardless of settings, or pixel format, or mask. My reasoning is the overlay layer is "on top" of the BG layer. At "zero" opacity, there is no overlay - only the BG remains

Exactly, but I think there might be a bug when using ConvertToRGB() try it. :)