Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Film grain
#21
(2017-02-25, 04:11 AM)Jetrell Fo Wrote:
(2017-02-23, 12:45 PM)Evit Wrote: Am I the only one who's not fond at all of grain added in post? The few examples I've seen so far have never been convincing but rather distracting.

I think it's safe to say that everyone has their own preferrence and that's okay.  You are probably not alone in that camp, but among some of us here, you may indeed be part of the minority.  I am also of the opinion that if it's going to be done it needs to be done with care.  If it's done sloppily, it's damaging, and a waste.  I believe most here that use or consider the use of grain plates, do their best to be very cautious, when doing so.  

In the end, we ALL want a quality experience, one way or the other.

The fake grain that I've seen caught my attention and became a distraction, looking like nothing more than an ugly and uniform added layer. What can I say, I must have seen only ones that were not done right and dismissed the whole idea to begin with.
I appreciate the grain that is found in actual 35mm films or in DNRless Blu-Rays, it looks natural to me, but adding grain to DNR material just seems twice as damaging, from the few examples I've seen at least. If you say it can be done "right" then I'm happy and looking forward to change my opinion in the future.
AKA thxita on OriginalTrilogy
I preserve movies as they first appeared in Italy.
Reply
Thanks given by:
#22
It will take me a while to write up, but yes, nearly everyone does it wrong.
Reply
Thanks given by: Evit
#23
poita, I'm eagerly waiting for your explanation! Ok
Reply
Thanks given by:
#24
I'm going to download a 35mm grain plate and have a play. I think what poita is saying is do this:

Code:
converttorgb()
r = showred().grain()
b = showblue().grain()
g = showgreen().grain()
mergergb( r, g, b )

function grain(clip c){
...
}

Actually, you probably want to first convert it to negative colours, and then do that. And shift the hue since film stores cyan, magenta, and yellow layers.
Reply
Thanks given by:
#25
I think that script does practically nothing more than apply grain "as is"... it should IMHO have different intensity for each color, like the following:

Code:
function grainplatergb (clip clip, "strength") {
strength = default( strength, 0.25)
grain=avisource("putyourowngrainplatefilehere.avi")\
.crop(0,0,clip.width,clip.height).loop.trim(0,clip.framecount-1)
### absolutely arbitrary and random values here! :D
rst=1
bst=1.1
gst=0.8
r=showred  ("Y8").overlay(clip.tweak(bright=1),grain,mode="softlight",opacity=strength*rst)
g=showgreen("Y8").overlay(clip.tweak(bright=1),grain,mode="softlight",opacity=strength*gst)
b=showblue ("Y8").overlay(clip.tweak(bright=1),grain,mode="softlight",opacity=strength*bst)
mergergb(r,g,b).converttoyv12
}
Reply
Thanks given by:
#26
Sure, but you still need to change the hue...

Code:
invert()
tweak(hue=60)
converttorgb()
y = showred().grainY()
c = showgreen().grainC()
m = showblue().grainM()
mergergb( y, c, m )
converttoyv24()
tweak(hue=-60)
invert()

function grainC(clip c){
...
}

And how do we know what intensity each layer should be?
Reply
Thanks given by:
#27
Okay, this is what I came up with (using 🔍grainzilla):

Code:
f = FFMpegSource2("inputfile.mkv").converttoyv24().crop(0,136,0,-133)
g = FFMpegSource2("1080P-35MM-DIGITAL-GRAIN.mov").converttoy8()
g = g ++ g.fliphorizontal() ++ g.flipvertical() ++ g.turnleft().turnleft()
g = g.crop(0,0,0,-269) ++ g.crop(0,269,0,0) ++ g.crop(0,135,0,-134)
g = g.loop(5)

f.tweak(hue=60,bright=1).overlay(g,mode="softlight",opacity=0.25)
converttorgb()
y = showred("Y8").overlay(g.trim(239,0),mode="softlight",opacity=0.25)
c = showgreen("Y8").overlay(g.trim(479,0),mode="softlight",opacity=0.25)
m = showblue("Y8").overlay(g.trim(719,0),mode="softlight",opacity=0.25)
mergergb(y, c, m)
converttoyv24()
tweak(hue=-60)

It looked horrid doing it without applying it to the base layer when upping the intensity. Now it looks great no matter how much you want to intensify the grain. Click to see on screenshot comparison (this was using opacity=.4 on all layers, way more grainy than you'd want to go):

🔍[Image: alien3.jpg]

Now the question is - is this the correct way to do it? And is there a better grainplate to use? Also, film is brown not black, should that affect how the base layer colours the grain?

I improved the code. Now it doesn't affect the brightness of the image at all:

Code:
f = FFMpegSource2("inputfile.mkv").converttoyv24().crop(0,136,0,-133)
g = FFMpegSource2("1080P-35MM-DIGITAL-GRAIN.mov").converttoy8()
g = g ++ g.fliphorizontal() ++ g.flipvertical() ++ g.turnleft().turnleft()
g = g.crop(0,0,0,-269) ++ g.crop(0,269,0,0) ++ g.crop(0,135,0,-134)
g = g.loop(5)

f.tweak(hue=60).overlay(g,mode="softlight",opacity=0.25)
invert()
converttorgb()
y = showred("Y8").overlay(g.trim(239,0),mode="softlight",opacity=0.25)
c = showgreen("Y8").overlay(g.trim(479,0),mode="softlight",opacity=0.25)
m = showblue("Y8").overlay(g.trim(719,0),mode="softlight",opacity=0.25)
mergergb(y, c, m)
converttoyv24()
tweak(hue=-60)
invert()

What I'm thinking is the base layer might affect the other three in an uneven way, I'm not yet sure what the x y z values should be, but something like:

remove this:

f.tweak(hue=60).overlay(g,mode="softlight",opacity=0.25)

Replace with:

y = showred("Y8").overlay(g.invert(),mode="softlight",opacity=x)
y = y
.overlay(g.trim(239,0),mode="softlight",opacity=0.25)
c = showgreen("Y8").overlay(g.invert(),mode="softlight",opacity=y)
c = c
.overlay(g.trim(479,0),mode="softlight",opacity=0.25)
m = showblue("Y8").overlay(g.invert(),mode="softlight",opacity=z)
m = m
.overlay(g.trim(719,0),mode="softlight",opacity=0.25)

Or we can do it in reverse order.

Here is a graphic I made:

[Image: shGNGhl.png]

Now imagine that is on negative film. When transferred to positive, this happens:

[Image: ECCrmjv.png]

The blue channel becomes yellow, the red channel becomes cyan, and the green channel becomes magenta. Thus if you want to add a layer of positive grain as well you should repeat the process. But you rotate the hue in the opposite direction ... i.e. start with tweak(hue=-60) and end with tweak(hue=60).
Reply
Thanks given by:
#28
OK, let's examine your script: Big Grin

I see you flipped/turned, and cropped, the grain plate to have more variations; I appreciated the idea, nice touch!
Also, I got the hue tweak - RGB -> YMC, right?

Alien 3 grain is certainly a bit exagerated, but I like that "gritty" look! Ok

But when you split the grain plate in R, G, B, you trimmed it in different parts: I don't think it's a good idea, because you are applying basically three different grain plates, so yes, the grain would be different for each color plane, but often each pixel will receive more than one single "grain", hence an improved intensity when two or three "grains" would be over it, instead a single one... still think that the same grain should be applied in different intensity for each color plane - again, no idea what the "about" values would be, poita should chime in about this.

Last thing: what is "35mm DIGITAL grain"?!?
Reply
Thanks given by:
#29
(2017-03-01, 03:05 PM)spoRv Wrote: But when you split the grain plate in R, G, B, you trimmed it in different parts: I don't think it's a good idea, because you are applying basically three different grain plates, so yes, the grain would be different for each color plane, but often each pixel will receive more than one single "grain", hence an improved intensity when two or three "grains" would be over it, instead a single one... still think that the same grain should be applied in different intensity for each color plane - again, no idea what the "about" values would be, poita should chime in about this.

Yes I'm working on the assumption we have a base layer grain, and then each emulsion layer has its own independent grain structure.

Okay, we can't rotate the hue because it crushes the yellows, cyans, and magentas. However we know how the colour channels map to film:

Negative film:

Blue -> Yellow
Red -> Cyan
Green -> Magenta

For positive film you invert image and then the colours map the same way.

Simple, thus here is my new script:

Code:
#Add negative grain
converttorgb()
y = showblue("Y8").overlay(g,mode="softlight",opacity=0.25)
y = y.invert().overlay(g.trim(239,0),mode="softlight",opacity=0.22).invert()
c = showred("Y8").overlay(g,mode="softlight",opacity=0.18)
c = c.invert().overlay(g.trim(479,0),mode="softlight",opacity=0.22).invert()
m = showgreen("Y8").overlay(g,mode="softlight",opacity=0.23)
m = m.invert().overlay(g.trim(719,0),mode="softlight",opacity=0.22).invert()
mergergb(c , m , y)
converttoyv12()

Now that looks really natural. You could repeat the whole process for positive film to add a positive grain layer. Notice we use different frames of grain of course:

Code:
#Add negative grain
converttorgb()
y = showblue("Y8").overlay(g,mode="softlight",opacity=0.25)
y = y.invert().overlay(g.trim(239,0),mode="softlight",opacity=0.22).invert()
c = showred("Y8").overlay(g,mode="softlight",opacity=0.18)
c = c.invert().overlay(g.trim(479,0),mode="softlight",opacity=0.22).invert()
m = showgreen("Y8").overlay(g,mode="softlight",opacity=0.23)
m = m.invert().overlay(g.trim(719,0),mode="softlight",opacity=0.22).invert()
mergergb(c , m , y)

#Add positive grain
invert()
y = showblue("Y8").overlay(g.trim(60,0),mode="softlight",opacity=0.25)
y = y.invert().overlay(g.trim(120,0),mode="softlight",opacity=0.22).invert()
c = showred("Y8").overlay(g.trim(60,0),mode="softlight",opacity=0.18)
c = c.invert().overlay(g.trim(390,0),mode="softlight",opacity=0.22).invert()
m = showgreen("Y8").overlay(g.trim(60,0),mode="softlight",opacity=0.23)
m = m.invert().overlay(g.trim(630,0),mode="softlight",opacity=0.22).invert()
mergergb(c , m , y)
converttoyv12()
invert()

That still looks natural.

(2017-03-01, 03:05 PM)spoRv Wrote: Last thing: what is "35mm DIGITAL grain"?!?

Good point I'll switch to one of 🔍these.
Reply
Thanks given by:
#30
Still don't get the negative/positive thing... don't we apply the grain plate (positive) to digital video (positive)? Why negative should be implied?

Switching to a non-"35mm digital grain" is a good move! Wink
Reply
Thanks given by:


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Help] Adding Grain - Suggestions? Nick_M 4 2,967 2022-08-04, 09:07 AM
Last Post: Bilbofett

Forum Jump:


Users browsing this thread: 1 Guest(s)