Vignetting

Targets:
image
Image Types:uint8, float32

Darken corners with a radial (elliptical) gradient. Simulates lens vignetting or natural light falloff. Use for lens realism or stylistic darkening.

Center of the image stays bright; corners and edges are darkened. Center position can be jittered for variety.

Arguments
intensity_range
tuple[float, float]
[0.2,0.5]

Darkening at corners: 0 = no effect, 1 = black. Default: (0.2, 0.5).

center_range
tuple[float, float]
[0.3,0.7]

Range for vignette center as fraction of width/height. (0.5, 0.5) = image center. Default: (0.3, 0.7).

p
float
0.5

Probability of applying the transform. Default: 0.5.

Examples
>>> import numpy as np
>>> import albumentations as A
>>> image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
>>>
>>> transform = A.Vignetting(intensity_range=(0.2, 0.5), p=1.0)
>>> result = transform(image=image)["image"]
Notes
  • Elliptical gradient centered at a random point (within center_range).
  • Quadratic falloff from center to edges.
See Also
  • Halftone: Dot pattern (printing-style) for vintage or print aesthetic.
  • FilmGrain: Luminance-dependent film grain for vintage texture.