FilmGrain

Function
Use the FilmGrain function to apply grain that corresponds to real film grain to an element. Grain is typically added to still or CG images so the images more closely match the inherent noisiness of film plates.

You can choose to apply a preset film stock, sample grain from an existing image, or create your own grain by adjusting the sliders.

 

Sampling Grain From An Image

 

Parameters
Type
Defaults
Function
version
string
"v3.0"
This parameter only appears in the script. It allows for versioning of the function and should therefore be left alone.
intensity float 1 The intensity of the grain. Values are between 0 and 2.
grainSize float 1 Size of the grain.
aspectRatio float defaultAspectRatio() Sets the aspect ratio of the grain to compensate for anamorphic or non-square pixel distortion
seed float time
The random generation seed. Set this to a constant value to freeze the grain.
filmStock string "Custom" Allows the user to select from preset film stocks or to apply custom values. Accepted inputs are:
“Custom”
“Eastman 5245”
“Eastman 5247”
“Eastman 5248ac”
“Eastman 5248nc”
“Eastman 5287”
“Eastman 5293ac”
“Eastman 5293nc
“Eastman 5296”
“Eastman 5298”
“Kodak 5246ac”
“Kodak 5246nc”
“Kodak 5274ac”
“Kodak 5274nc”
“Kodak 5277”
“Kodak 5279”
“ac” indicates a stock with aperture correction. “nc” indicates no aperture correction.
r, g, bStdDev float .05 This controls the relative intensity between the red, green, and blue channels.
r, g, bSoftness float 1.2 This value controls the softness of the grain. Note that this will also affect the apparent size of the grain. You may need to decrease grainSize to compensate.
r, g, bFilmResponse float -1 This value determines the distribution of the grain relative to the luminance of the image.
colorCorr float 0

This parameter specifies the apparent colorfulness of the grain.

The value represents how closely the grain in each channel overlaps. This means that negative color correlation values decrease the amount of overlap, which increases the apparent color of the grain, while positive values decrease its colorfulness.


Synopsis

image FilmGrain( 
image In,
const char * version,
float intensity,
float grainSize,
float aspectRatio,
float seed,
const char * filmStock,
float rStdDev,
float gStdDev,
float bStdDev,
float rSoftness,
float gSoftness,
float bSoftness,
float rFilmReponse,
float gFilmReponse,
float bFilmReponse,
float colorCorr,
);


Script

image FilmGrain( 
In,
“version”,
intensity,
grainSize,
aspectRatio,
seed,
filmStock,
rStdDev,
gStdDev,
bStdDev,
rSoftness,
gSoftness,
bSoftness,
rFilmReponse,
gFilmReponse,
bFilmReponse,
colorCorr,
);


Command Line

Not appropriate for command line.