Illumination patterns: directional (linear), corner shadows/highlights, or gaussian. mode and params control shape and strength. Simulates lighting variation.
This transform simulates different lighting conditions by applying controlled illumination patterns. It can create effects like:
These effects can be used to:
modeType of illumination pattern:
intensity_rangeRange for effect strength. Values between 0.01 and 0.2:
effect_typeType of lighting change:
angle_rangeRange for gradient angle in degrees. Controls direction of linear gradient:
center_rangeRange for spotlight position. Values between 0 and 1 representing relative position:
sigma_rangeRange for spotlight size. Values between 0.2 and 1.0:
pProbability of applying the transform. Default: 0.5
>>> import albumentations as A
>>> # Simulate sunlight through window
>>> transform = A.Illumination(
... mode='linear',
... intensity_range=(0.05, 0.1),
... effect_type='brighten',
... angle_range=(30, 60)
... )
>>>
>>> # Create dramatic corner shadow
>>> transform = A.Illumination(
... mode='corner',
... intensity_range=(0.1, 0.2),
... effect_type='darken'
... )
>>>
>>> # Add multiple spotlights
>>> transform1 = A.Illumination(
... mode='gaussian',
... intensity_range=(0.05, 0.15),
... effect_type='brighten',
... center_range=(0.2, 0.4),
... sigma_range=(0.2, 0.3)
... )
>>> transform2 = A.Illumination(
... mode='gaussian',
... intensity_range=(0.05, 0.15),
... effect_type='darken',
... center_range=(0.6, 0.8),
... sigma_range=(0.3, 0.5)
... )
>>> transforms = A.Compose([transform1, transform2])