Repository navigation
Film Stock 0.1.0: the picture shot on film and printed, its grain simulated grain by grain from the stock's granularity, with weave, halation, flicker, dirt, a 24 fps cadence and day for night - #30
Merged
Conversation
…ulated grain by grain from the stock's granularity, with weave, halation, flicker, dirt, a 24 fps cadence and day for night See the pull request description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The picture shot on film and printed, modeled from the film rather
than laid over it.
Grain is the Boolean model of stochastic geometry as Newson, Delon and
Galerne used it for film (CGF 2017), simulated rather than summarized:
for every pixel and layer the number of developed grains is drawn from
its Poisson law, and once the grains are big enough to see (0.4 px),
each is drawn where it falls with its own log-normal radius and the
pixel's coverage by it is the lens where it meets the pixel's disk.
Both give the model's mean exactly and its spread within about 15%
(dev/protos/film_stock/grain_check.py, against the model rasterized).
The grain's size on the film comes from Kodak's published rms
granularity by Nutting's formula, and on screen from the Gauge (35 mm,
16 mm or Super 8: micrometers of film under a pixel), so smaller film
is grainier, softer, weaves further and halates wider, as it does.
Six stocks (two modern color negatives, a 1970s one, a color reversal,
two black and whites), each a table: characteristic curve, grain
radii and spread, resolving power, halation, dye impurity, tints. The
negative is read a little soft (softer in color) and printed on a
steep print curve, or the reversal shown as it is. Halation exposes
the red layer around what is brighter than white; the gate weaves;
the lamp flickers (capped at 5%, under WCAG's 10%); dust, hairs and
scratches land on the print; frames hold at 24, 18 or 16 a second;
Day for Night after Thompson, Shirley and Ferwerda (JGT 2002), its
second blur a triangle. Beats kick the film in the gate and drops
splice the reel, through the flash gate; loudness pushes the grain;
sections show a cue mark.
Patents (private/patents/film_stock.md, board #4825): the task's paper
(Zhang, Wang, Tian and Pappas, TOG 2023) is Northwestern's US
12,705,810, granted 2026-08-11, which claims deriving the grain's
second-order statistics from constant-value portions and synthesizing
correlated signal-dependent noise from them; nothing here derives
statistics or scales noise. Netflix's AV1 grain (US 10,839,489) and
Autodesk's reference-image measurement (US 7,873,210) kept out too.
Measured on the M2 Pro at 1280 x 720: 2.3 ms GPU at the defaults, 60
fps; Super 8 at Grain 3 draws its grains one by one at 6 to 13 ms,
still 60 fps (an earlier loop enumerated five times the grains it
needed, dev/probes/film_stock_cost.py). Flashes: Off adds nothing on
the dancer, flowers or koi, Calm at most one a second, red 0
everywhere. Idle: 0 of 349 operators cook unused.
Showreel 0.1.28 with twenty-seven effects; README hero re-tiled.