Vignetting

Targets:
image
volume
Image Types:uint8, float32

Apply vignetting effect by darkening image corners with a radial gradient.

Simulates the natural light falloff that occurs in camera lenses, where corners and edges of an image appear darker than the center.

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

Range for the darkening intensity at corners. 0 means no effect, 1 means corners go fully black. Default: (0.2, 0.5).

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

Range for jittering the vignette center position, expressed as fractions of width/height. (0.5, 0.5) is the 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

The vignette is an elliptical gradient centered at a random point within center_range. The darkening follows a quadratic falloff from center to edges.