LensFlare
Apply realistic lens flare effect with starburst rays and ghost reflections.
Simulates optical lens flare artifacts including a central bright spot with radiating starburst pattern and secondary ghost reflections along the axis from source to image center.
flare_roiRegion of interest for flare source placement as (x_min, y_min, x_max, y_max) in normalized [0, 1] coords. Default: (0, 0, 1, 0.5).
num_ghosts_rangeRange for number of ghost reflections. Default: (3, 7).
intensity_rangeRange for overall flare brightness. Default: (0.3, 0.7).
num_rays_rangeRange for number of starburst rays. Default: (4, 8).
bloom_rangeRange for bloom blur radius as fraction of image diagonal. Default: (0.01, 0.05).
pProbability of applying the transform. Default: 0.5.
>>> import numpy as np
>>> import albumentations as A
>>> image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
>>> transform = A.LensFlare(intensity_range=(0.3, 0.6), p=1.0)
>>> result = transform(image=image)["image"]Ghost reflections appear along the line between the flare source and the image center, at mirrored positions. Their size decreases and color shifts slightly as they get farther from the source.