Struct PixelNoiseSettings
Immutable configuration struct for pixel (per-pixel random) noise generation. Bundles noise intensity, the probability distribution used to draw random offsets, and whether noise is applied identically across all colour channels or independently per channel. The parameter model intentionally mirrors Photoshop's "Add Noise" filter for familiarity.
Inherited Members
Namespace: Scylla.Core.Util.Noise
Assembly: ScyllaCore.dll
Syntax
public readonly struct PixelNoiseSettings
Remarks
Pixel noise is fundamentally different from coherent noise: it applies an independent random offset to every pixel, with no spatial correlation between neighbouring pixels. This makes it suitable for film grain, dithering, and sensor noise simulation, but not for terrain or texture generation where spatial continuity is required.
Using default(PixelNoiseSettings) produces a zero-noise state
(Amount = 0, Uniform,
non-monochromatic). Prefer the constructor or a named preset such as
Default to avoid accidentally producing a no-op configuration.
This struct is readonly and allocation-free. Named presets are provided for the most common use cases; pass a custom instance to the constructor for fine-grained control.
Constructors
PixelNoiseSettings(float, PixelNoiseDistribution, bool)
Creates a new PixelNoiseSettings with fully specified parameters.
amount is clamped to [0, 1]; the remaining parameters are
assigned directly without validation.
Declaration
public PixelNoiseSettings(float amount, PixelNoiseDistribution distribution, bool monochromatic)
Parameters
| Type | Name | Description |
|---|---|---|
| float | amount | Noise intensity as a fraction of the full channel range, in [0, 1]. Values outside
this range are clamped automatically. |
| PixelNoiseDistribution | distribution | The probability distribution for drawing random noise offsets. Use Uniform for harsh, even grain and Gaussian for naturalistic film-grain appearance. |
| bool | monochromatic | When |
Fields
Amount
Noise intensity expressed as a fraction of the full channel range, in [0, 1].
A value of 0.0 applies no noise; 1.0 applies the maximum possible
noise offset (100% of channel range). The constructor automatically clamps this
value to [0, 1]. Typical values for subtle effects are in [0.02, 0.15].
Declaration
public readonly float Amount
Field Value
| Type | Description |
|---|---|
| float |
Default
Default preset: 10% uniform colour noise (non-monochromatic). A moderate, visible level of noise suitable as a neutral starting point or for stylized rough textures.
Declaration
public static readonly PixelNoiseSettings Default
Field Value
| Type | Description |
|---|---|
| PixelNoiseSettings |
Distribution
The probability distribution used when drawing random noise offsets for each pixel and channel. Uniform gives an equal chance to all magnitudes up to Amount, producing harsher, evenly-spread grain. Gaussian concentrates offsets near zero with occasional larger speckles, producing a more naturalistic film-grain look.
Declaration
public readonly PixelNoiseDistribution Distribution
Field Value
| Type | Description |
|---|---|
| PixelNoiseDistribution |
See Also
Dither
Dither preset: 2% uniform monochromatic noise. The minimal-noise configuration intended for ordered or random dithering when quantising high-bit-depth images to lower colour depths. The low amplitude keeps the dither effect below the threshold of conscious perception while still breaking up banding artefacts.
Declaration
public static readonly PixelNoiseSettings Dither
Field Value
| Type | Description |
|---|---|
| PixelNoiseSettings |
FilmGrain
Film grain preset: 8% Gaussian monochromatic noise. Models cinematic photographic grain - small, mostly-neutral speckle with the rare occasional bright dot, identical across colour channels. Suitable for cinematic post-processing, aged photograph effects, and analogue video simulation.
Declaration
public static readonly PixelNoiseSettings FilmGrain
Field Value
| Type | Description |
|---|---|
| PixelNoiseSettings |
Heavy
Heavy noise preset: 50% uniform colour noise. Produces a strong, highly visible speckle with significant colour variation across pixels. Useful for heavily stylized effects, corrupted-signal aesthetics, or when testing noise pipeline correctness at high amplitudes.
Declaration
public static readonly PixelNoiseSettings Heavy
Field Value
| Type | Description |
|---|---|
| PixelNoiseSettings |
Monochromatic
Controls whether the same noise offset is used for all three colour channels or whether each channel receives an independent random offset.
When true (monochromatic), identical noise is applied to R, G, and B,
producing grayscale speckle - the grain appears as neutral bright or dark dots.
This is the conventional film grain appearance.
When false (colour), each channel receives its own independent noise
value, producing coloured speckle where individual pixels may shift toward red,
green, or blue. This mimics the colour noise seen in underexposed digital photos.
Declaration
public readonly bool Monochromatic
Field Value
| Type | Description |
|---|---|
| bool |
SubtleMono
Subtle monochromatic grain preset: 5% Gaussian monochromatic noise. A very gentle grain that adds surface texture without drawing attention to itself. Well suited for adding micro-detail to otherwise perfectly smooth rendered surfaces or UI elements.
Declaration
public static readonly PixelNoiseSettings SubtleMono
Field Value
| Type | Description |
|---|---|
| PixelNoiseSettings |