Posts: 1,974
Threads: 54
Joined: 2015 Apr
Thanks: 272
Given 401 thank(s) in 252 post(s)
Country:
Posts: 612
Threads: 26
Joined: 2016 Nov
Thanks: 1
Given 410 thank(s) in 160 post(s)
It will take me a while to write up, but yes, nearly everyone does it wrong.
Posts: 7,151
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1498 thank(s) in 969 post(s)
Country:
Posts: 2,260
Threads: 83
Joined: 2015 Jan
Thanks: 488
Given 855 thank(s) in 446 post(s)
2017-03-01, 03:31 AM
(This post was last modified: 2017-03-01, 03:38 AM by Valeyard.)
Posts: 7,151
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1498 thank(s) in 969 post(s)
Country:
Posts: 2,260
Threads: 83
Joined: 2015 Jan
Thanks: 488
Given 855 thank(s) in 446 post(s)
2017-03-01, 04:10 AM
(This post was last modified: 2017-03-01, 04:17 AM by Valeyard.)
Posts: 2,260
Threads: 83
Joined: 2015 Jan
Thanks: 488
Given 855 thank(s) in 446 post(s)
2017-03-01, 05:50 AM
(This post was last modified: 2017-03-01, 03:24 PM by Valeyard.)
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):
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:
Now imagine that is on negative film. When transferred to positive, this happens:
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).
Posts: 7,151
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1498 thank(s) in 969 post(s)
Country:
Posts: 2,260
Threads: 83
Joined: 2015 Jan
Thanks: 488
Given 855 thank(s) in 446 post(s)
2017-03-01, 04:01 PM
(This post was last modified: 2017-03-01, 04:27 PM by Valeyard.)
(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.
Posts: 7,151
Threads: 601
Joined: 2015 Jan
Thanks: 1081
Given 1498 thank(s) in 969 post(s)
Country:
|