How does film grain work in Dehancer Film

There are many ways to simulate film grain in digital post-processing. Either way, there are two different methods and types of grain simulation:

  1. Natural grain scanned from real footages shot on film.
  2. Procedural (computer generated) grain.

Both approaches have rights to exist and both have their pros and cons. At first glance, scanned grain is the only ‘honest’ way to add grain to digital picture. But no matter how real it is in its origin, this type of grain isn’t related to the image, doesn’t represent it and therefore will always look unnatural and superimposed. Also there is significant limitation in controlling the characteristics of sampled grain – size, texture, density etc.

After many years of movie and photographic film study and many experiments on darkroom printing and film scanning, we managed to create a reliable mathematical 3D model that allows us to generate flexibly controlled analogue-like procedural grain.

This model is based on physical properties of real emulsion. Here are some of them:

  • Grain isn’t just overlaid on the image. Image consists of grain. One of the key points (but not the only one) that follows from this is that image detail depends on grain size, and usually visible details do not exceed grain size.
  • Film emulsion has a certain thickness, i.e. it is not flat. When passing through multiple layers of emulsion, light is reflected, refracted and diffused in many ways.
  • Silver halides (as well as dye granules) have volume. Accordingly, they are turned differently relative to film plane and therefore inevitably cast shadows.
  • There are different shapes of granules – classical rounded and flat grain, also called ’T-grain’.
  • Silver halides are distributed unevenly in the depth of emulsion layer. Tiny grains do not exist alone, forming complex conglomerations.
  • – There is always considerable amount of grain in highlights because these areas correspond to maximum negative density, i.e. maximum accumulation of silver halides (Dmax). These always affect positive image printed from film to film or from film to photo paper. At the same time, due to the nature of human perception, grain is less noticeable in the highlights (but cannot be null).
  • Grain is always found in deep shadows too, as these areas correspond to minimum exposure, i.e. minimal amount of silver halides (Dmin, most transparent areas of the negative). Accordingly, when printing from film to film (or from film to paper), print media is getting maximum amount of light in the shadows of the final image. In this way, the grain of print media itself becomes visible, along with slight grain of the source negative film.

Our algorithm generates grain based on local colour and brightness characteristics of the image, and thus is always related with it.

The granules are in fact 3D particles in the volume. Each granule is rotated relative to the image plane by a certain angle. Granules are randomly shifted and sometimes grouping in clusters. The resulting structure of ‘halides’ is superimposed over the original image (not vice versa like with traditional approach), taking into account the reflection, refraction and diffusion effects in the layers of ‘emulsion’.

In the process of printing simulation, the initial negative grain becomes positive and is built into the image as an integral part of it, that is, it does not look like overlaid on top.

On the one hand, procedural grain eliminates the need to use quite large scan files, which should be included in the installer bundle. In this case, tens or even hundreds of high-resolution scans would be required to avoid repeating patterns. And also results in additional tricks – rotation and mirroring for each frame, etc.

On the other hand, grain generation requires computational resources and inevitably slows down the framerate in the viewport and during the rendering process. However, we managed to accommodate these losses to a mere 5% of the plugin’s total performance.

How it works?

Continue reading “How does film grain work in Dehancer Film”