← Home

All Transforms (127)

Browse all Albumentations image augmentation transforms with descriptions and supported targets.

Image-Only Transforms

(67)

Transforms that modify only pixel data without affecting annotations.

AdditiveNoise

Random noise to channels: uniform, gaussian, laplace, or beta. spatial_mode: constant, per_pixel, or shared. Params depend on noise_type.

image

AdvancedBlur

Blur with a generalized Gaussian kernel (shape from beta), optional anisotropy and rotation, plus kernel noise. Broader effect range than GaussianBlur.

image

AtmosphericFog

Add depth-dependent fog via the atmospheric scattering equation and a synthetic depth map. Use for outdoor and driving robustness to haze.

image

AutoContrast

Stretch intensity to full range (autocontrast). method: CDF or PIL-style. cutoff, ignore trim extremes. Use for normalizing brightness/contrast across images.

image

Blur

Average pixels over a random square kernel (box filter). Fast, soft blur; kernel size from blur_limit. Good for mild smoothing or augmentation variety.

image

CLAHE

Contrast Limited Adaptive Histogram Equalization: local contrast with clip_limit and tile_grid_size. Good for non-uniform lighting; preserves detail.

image

ChannelDropout

Randomly drop channels. channel_drop_range, fill. Replaces selected channels with fill; improves robustness to missing channels. Image-only.

image

ChannelShuffle

Permute image channels. By default the permutation is random (uniform over all orderings); set `channel_order` to pin a fixed reordering.

image

ChannelSwap

Fixed channel reordering (e.g. RGB->BGR). Convenience subclass of `ChannelShuffle` with a required `channel_order` argument.

image

ChromaticAberration

Add lateral chromatic aberration: shift red and blue relative to green. distortion_limit and shift_limit control strength. Simulates lens color fringing.

image

ColorJitter

Randomly apply brightness, contrast, saturation, hue in random order. Separate ranges per effect. Strong color augmentation for classification and detection.

image

Defocus

Simulate out-of-focus lens: disc-shaped kernel (aperture) plus optional Gaussian alias blur. Radius and alias_blur control strength and edge softness.

image

Dithering

Reduce colors via dithering: ordered Bayer, error diffusion, or random. num_levels, method. Good for retro look or limited-color output.

image

Downscale

Reduce quality by downscale then upscale. scale_min and scale_max control factor. Simulates resolution or compression loss.

image

Emboss

Apply emboss effect (directional highlight and shadow). strength_range controls intensity. Pseudo-3D look; for texture or style augmentation.

image

Equalize

Equalize histogram to spread intensities. mode: global or adaptive; mask optional. Improves contrast normalization across datasets.

image

FDA

Fourier Domain Adaptation: swap low-frequency spectrum with reference (metadata_key). beta_limit controls extent. Good for unsupervised domain adaptation (UDA).

image

FancyPCA

Add color variation via PCA on RGB: perturb components by alpha_std. Simulates natural lighting variation (ImageNet-style). Good for object recognition.

image

FilmGrain

Analog film grain: luminance-dependent, spatially correlated noise. Distinct from i.i.d. GaussNoise or ShotNoise. Use for vintage or film-like augmentation.

image

FromFloat

Convert image from float [0, 1] to discrete type (e.g. uint8 [0, 255]). Inverse of ToFloat. max_value and dtype control scaling and output type.

image

GaussNoise

Add Gaussian (normal) noise to the image. i.i.d. per pixel (or per block if scaled). Use for robustness to sensor or transmission noise.

image

GaussianBlur

Smooth the image with a Gaussian kernel (weighted average; reduces noise and fine detail). Kernel size and sigma are sampled randomly per call.

image

GlassBlur

Simulate frosted glass: Gaussian blur then local random pixel shuffles. Controlled by sigma (blur), max_delta (shuffle distance), and iterations.

image

HEStain

H&E stain augmentation for histopathology. method: preset, random_preset, vahadane, macenko. Simulates staining variation for robust pathology models.

image

Halftone

Halftone dot pattern (printing-style). Continuous tones become dots of varying size. Use for vintage or print-aesthetic augmentation.

image

HistogramMatching

Match input histogram to a reference image (metadata_key). Aligns intensity and contrast; blend_ratio controls strength. Good for cross-domain style alignment.

image

HueSaturationValue

Randomly shift hue, saturation, and value (HSV). Separate ranges per channel. Common for color augmentation in classification.

image

ISONoise

Add camera-sensor-like noise scaling with intensity (high ISO). color_shift and intensity range control strength. Good for low-light or camera noise simulation.

image

Illumination

Illumination patterns: directional (linear), corner shadows/highlights, or gaussian. mode and params control shape and strength. Simulates lighting variation.

image

ImageCompression

Reduce image quality via JPEG or WebP compression. quality_range and compression_type control strength and format. Simulates real-world compression artifacts.

image

InvertImg

Invert the input image by subtracting pixel values from max values of the image types, i.e., 255 for uint8 and 1.0 for float32.

image

LensFlare

Add lens flare: starburst rays and ghost reflections from a bright source. Use for outdoor or backlit robustness and optical-artifact simulation.

image

MedianBlur

Replace each pixel with median in a square window. Removes salt-and-pepper noise; edges sharper than box or Gaussian. Kernel size from blur_limit.

image

MotionBlur

Simulate motion blur along a random direction (camera shake or moving subject). Kernel size and angle sampled per call; optional shift for off-center streaks.

image

MultiplicativeNoise

Multiply image by random per-pixel or per-channel factor. multiplier_range controls strength. Simulates illumination or gain variation; preserves zeros.

image

Normalize

Applies various normalization techniques to an image. The specific normalization technique can be selected with the `normalization` parameter.

image

PhotoMetricDistort

SSD-style photometric distortion: brightness, contrast, saturation, hue, channel shuffle; each with probability distort_p. For detection training.

image

PixelDistributionAdaptation

Adapts the pixel value distribution of an input image to match a reference image using statistical transformations (PCA, StandardScaler, or MinMaxScaler).

image

PlanckianJitter

Simulate color temperature variation via Planckian locus jitter. mode and magnitude control the shift. Good for robustness to different light sources.

image

PlasmaBrightnessContrast

Plasma fractal (Diamond-Square) pattern varies brightness and contrast spatially. brightness_range, contrast_range. Organic, non-uniform look.

image

PlasmaShadow

Plasma fractal (Diamond-Square) shadow: organic darkening. shadow_intensity_range, roughness. Good for natural shading and lighting variation.

image

Posterize

Reduce bits per color channel (e.g. 8→4). num_bits_range controls strength; lower gives stronger posterization. Simulates low-bit-depth or compression.

image

RGBShift

Shift R, G, B with separate ranges. Specialized AdditiveNoise with constant uniform shifts. Params: r_shift_limit, g_shift_limit, b_shift_limit.

image

RandomBrightnessContrast

Randomly adjust brightness and contrast with separate ranges. Simple and fast; good baseline color augmentation for classification and detection.

image

RandomFog

Simulate fog by overlaying semi-transparent circles and blending with a fog color. Good for driving or outdoor robustness to weather.

image

RandomGamma

Apply random gamma correction (power-law on intensity). gamma_limit controls range. Common for exposure and display variation.

image

RandomGravel

Add gravel-like particle artifacts on the image. Number and size of particles and ROI are configurable. Simulates dirt or debris on a lens or surface.

image

RandomRain

Add rain streaks (semi-transparent lines), optional blur and brightness reduction. Good for outdoor or driving robustness to rainy conditions.

image

RandomShadow

Simulate cast shadows by darkening random regions. shadow_roi, num_shadows, shadow_dimension control placement and softness. Improves lighting robustness.

image

RandomSnow

Add snow overlay via bleach (brightness threshold) or texture (noise-based overlay). Good for winter or snowy-scene robustness in outdoor imagery.

image

RandomSunFlare

Simulate lens flare: circles of light and rays. src_radius, num_flare_circles, angle control the effect. Good for outdoor robustness.

image

RandomToneCurve

Randomly warp the tone curve to change contrast and tonal distribution. scale and scale_upper control strength. Good for exposure variation.

image

RingingOvershoot

Create ringing or overshoot artifacts via 2D sinc convolution. blur_limit and cutoff control strength. Simulates sharpening or compression artifacts.

image

SaltAndPepper

Apply salt-and-pepper (impulse) noise: randomly set pixels to min or max. amount and salt_vs_pepper control density and ratio. Same mask for all channels.

image

Sharpen

Sharpen the image via kernel or Gaussian unsharp method. alpha and lightness control strength. Enhances edges; useful for document or detail-sensitive tasks.

image

ShotNoise

Shot noise (Poisson) in linear light space. Sensor-realistic; use for low-light or photon-limited imaging and camera simulation.

image

Solarize

Invert pixel values above a threshold. threshold_range controls cutoff. Strong highlight inversion; useful for data augmentation.

image

Spatter

Simulate lens occlusion from rain or mud: splatter patterns and optional blur. fill and spread control appearance. Good for dirty or wet lens robustness.

image

Superpixels

Replace image with superpixel segmentation (SLIC). p_replace, n_segments, max_size control fraction and segment count. Reduces fine texture.

image

TextImage

Render text onto images from metadata. font_path, stopwords, augmentations, fraction_range, font_size_fraction_range, font_color, metadata_key, clear_bg.

image

ToFloat

Convert the input image to float32 in [0, 1] by dividing by max_value. Useful for normalizing before neural networks or algorithms that expect float input.

image

ToGray

Convert to grayscale (weighted by channel weights). Optionally replicate to keep shape. Useful for grayscale training or channel reduction.

image

ToRGB

Convert grayscale image to RGB by replicating the single channel to three. No color information added; use when a model expects 3-channel input.

image

ToSepia

Apply sepia (brownish vintage) filter via fixed color matrix. Optional alpha for blending with original. Good for style or temporal variation in datasets.

image

UnsharpMask

Sharpen via unsharp masking: blur, subtract, add back. blur_limit, sigma_limit, alpha control strength. Luminance unchanged; edges enhanced.

image

Vignetting

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

image

ZoomBlur

Radial blur from zoom-during-exposure: average the image with copies zoomed from the center at random factors. Creates motion-like streaks away from the center.

image

Dual Transforms

(53)

Transforms that modify images along with masks, bounding boxes, and keypoints. Essential for detection and segmentation pipelines.

Affine

Apply affine transformations: translation, rotation, scale, shear. Params: scale, translate, rotate, shear, interpolation, fill.

imagemaskbboxeskeypoints

AtLeastOneBBoxRandomCrop

Random crop of fixed size that contains at least one bbox. erosion_factor controls overlap with reference box. Use when some object loss is acceptable.

imagemaskbboxeskeypoints

BBoxSafeRandomCrop

Random crop that keeps all bboxes inside (erosion_rate). Use when losing any object is unacceptable. For at least one bbox use AtLeastOneBBoxRandomCrop.

imagemaskbboxeskeypoints

CenterCrop

Crop the center region of fixed height and width. Optional pad when crop exceeds image. All targets share the same center window. Good for center-focused data.

imagemaskbboxeskeypoints

CoarseDropout

Randomly drop rectangular regions from image (and optionally mask). num_holes_range, hole_size_range, fill. For robustness and regularization.

imagemaskbboxeskeypoints

ConstrainedCoarseDropout

Apply coarse dropout only in regions containing specified objects (mask or bbox labels). mask_indices or bbox_labels; num_holes_range, hole size ranges.

imagemaskbboxeskeypoints

Crop

Crop a fixed region by (x_min, y_min, x_max, y_max). Deterministic; optional pad when region exceeds image. Use for fixed ROI or sliding-window pipelines.

imagemaskbboxeskeypoints

CropAndPad

Crop or pad each side by pixels (px) or fractions (percent). Positive pad, negative crop. Per-side control via tuples. Good for letterboxing or trimming.

imagemaskbboxeskeypoints

CropNonEmptyMaskIfExists

Crop a region containing non-empty mask pixels; if mask empty or missing, fall back to random crop. Good for segmentation to focus on labeled regions.

imagemaskbboxeskeypoints

D4

Apply one of eight D4 square symmetries (rotations and reflections). Keeps square shape. Use group_element for deterministic TTA (e.g. run all 8 then inverse).

imagemaskbboxeskeypoints

ElasticTransform

Apply elastic deformation to images, masks, bboxes, keypoints. Params: alpha, sigma, interpolation. Uses Gaussian-smoothed random displacement fields.

imagemaskbboxeskeypoints

Erasing

Randomly erase rectangular regions (Random Erasing). area_ratio_range, aspect_ratio_range, fill. Improves robustness; common in image classification.

imagemaskbboxeskeypoints

FrequencyMasking

Mask spectrogram in frequency domain. freq_mask_param sets max mask length; SpecAugment-style. Single vertical mask; use XYMasking for more flexibility.

imagemaskbboxeskeypoints

GridDistortion

Apply grid distortion by dividing the image into cells and warping each. Params: num_steps, distort_limit, interpolation, normalized.

imagemaskbboxeskeypoints

GridDropout

Drop rectangular regions in a grid. ratio, unit_size_range or holes_number_xy, random_offset, shift_xy, fill. Applies to images, masks, bboxes, keypoints.

imagemaskbboxeskeypoints

GridElasticDeform

Elastic deformations via a grid: displace control points and interpolate. num_grid_xy and magnitude control density and strength. Good for local stretching.

imagemaskbboxeskeypoints

GridMask

Drop grid-line regions (horizontal and vertical stripes). num_grid_range, line_width_range, rotation_range, fill. Unlike GridDropout which drops cells.

imagemaskbboxeskeypoints

HorizontalFlip

Flip the image left-right (mirror). Same size and layout; self-inverse. Use inverse() for TTA to restore predictions to original orientation.

imagemaskbboxeskeypoints

LetterBox

Scale image to fit a target canvas preserving aspect ratio, then pad to exact canvas size: YOLO letterbox, equivalent to LongestMaxSize + PadIfNeeded.

imagemaskbboxeskeypoints

LongestMaxSize

Rescale an image so that the longest side is equal to max_size or sides meet max_size_hw constraints, keeping the aspect ratio.

imagemaskbboxeskeypoints

MaskDropout

Dropout random objects in a mask; zero those regions in image and mask. max_objects, fill, fill_mask; filters bboxes/keypoints by visibility.

imagemaskbboxeskeypoints

Morphological

Dilation or erosion with a structuring element (scale). For document scans: dilation fills gaps in text; erosion removes noise. Operation and scale per call.

imagemaskbboxeskeypoints

Mosaic

Combine multiple images and annotations into one image via a mosaic grid. Uses metadata for additional images; common in object detection training.

imagemaskbboxeskeypoints

NoOp

Identity transform (does nothing). Passes all targets through unchanged. Use as placeholder or in conditional pipelines.

imagemaskbboxeskeypoints

OpticalDistortion

Apply optical distortion (lens/camera or fisheye model) to images, masks, bboxes, keypoints. Params: distort_limit, mode (camera/fisheye), interpolation.

imagemaskbboxeskeypoints

OverlayElements

Apply overlay images/masks onto an input image (e.g. stickers, logos). Optional bboxes and masks for placement. Uses metadata_key.

imagemask

Pad

Pad image sides by a number of pixels (all sides, x/y, or per-side). Params: padding, fill, fill_mask, border_mode. Supports image, mask, bboxes, keypoints.

imagemaskbboxeskeypoints

PadIfNeeded

Pad image to meet min height/width and/or divisibility (pad_height_divisor, pad_width_divisor). Position, fill configurable.

imagemaskbboxeskeypoints

Perspective

Apply random four-point perspective transformation. Params: scale, keep_size, border_mode, fill, interpolation. Supports image, mask, bboxes, keypoints.

imagemaskbboxeskeypoints

PiecewiseAffine

Apply piecewise affine transformations via a regular grid of control points. Params: scale, nb_rows, nb_cols, interpolation.

imagemaskbboxeskeypoints

PixelDropout

Drop random pixels. dropout_prob, per_channel, drop_value; applies to image and mask. Fill: constant, random, or inpainting.

imagemaskbboxeskeypoints

RandomCrop

Crop a random region of fixed height and width. Optional pad when crop exceeds image. All targets cropped together. Common for fixed-resolution training.

imagemaskbboxeskeypoints

RandomCropFromBorders

Randomly remove a strip from each border (crop_left/right/top/bottom). No resize; output smaller. Good for trimming variable borders or slight zoom.

imagemaskbboxeskeypoints

RandomCropNearBBox

Crop around a reference bbox (cropping_bbox_key) with random shift (max_part_shift). Use when you have a region of interest to augment.

imagemaskbboxeskeypoints

RandomGridShuffle

Split image into a grid and randomly permute cells; same shuffle for all targets. Grid size from grid (e.g. (3, 3)). Breaks global layout, keeps local content.

imagemaskbboxeskeypoints

RandomResizedCrop

Random crop with scale and ratio ranges (torchvision-style), then resize to size. Standard for training on varying resolutions; scale and ratio control crop.

imagemaskbboxeskeypoints

RandomRotate90

Randomly rotate by 90° (0, 90, 180, or 270). Supports image, mask, bboxes, keypoints, volume. Set group_element for TTA; use inverse() to restore predictions.

imagemaskbboxeskeypoints

RandomScale

Resize by a random scale factor (scale_limit). Output size differs from input; all targets scaled together. Useful for scale augmentation without cropping.

imagemaskbboxeskeypoints

RandomSizedBBoxSafeCrop

Random crop keeping every bbox inside, then resize to (height, width). erosion_rate sets minimum crop size. Use when no object can be cut off.

imagemaskbboxeskeypoints

RandomSizedCrop

Random crop with height in min_max_height and aspect ratio (w2h_ratio), then resize to size. Scale and aspect variation with fixed output size.

imagemaskbboxeskeypoints

Resize

Resize to given height and width. Params: height, width, interpolation, area_for_downscale. Supports image, mask, bboxes, keypoints.

imagemaskbboxeskeypoints

Rotate

Rotate by a random angle from limit (degrees). Optional crop_border removes black corners. Same rotation for image, mask, bboxes, keypoints.

imagemaskbboxeskeypoints

SafeRotate

Rotate by a random angle (limit) but scale to fit in the original frame. No black corners; output size equals input. Good when fixed dimensions are required.

imagemaskbboxeskeypoints

ShiftScaleRotate

One-step affine: random shift, scale, and rotation. Limits sampled per call; good for pose or scale augmentation without separate transforms.

imagemaskbboxeskeypoints

SmallestMaxSize

Rescale an image so that minimum side is equal to max_size or sides meet max_size_hw constraints, keeping the aspect ratio.

imagemaskbboxeskeypoints

SquareSymmetry

Alias for D4: one of eight square symmetries (rotations and reflections). Use group_element for deterministic TTA (e.g. run all 8 then inverse).

imagemaskbboxeskeypoints

ThinPlateSpline

Apply Thin Plate Spline (TPS) for smooth, non-rigid deformations. Control points warp the image like pins on a thin plate; smooth interpolation between points.

imagemaskbboxeskeypoints

TimeMasking

Mask spectrogram in time domain. time_mask_param sets max mask length; SpecAugment-style. Single horizontal mask; use XYMasking for more flexibility.

imagemaskbboxeskeypoints

TimeReverse

Reverse time axis of a spectrogram (time inversion). Alias for HorizontalFlip; for audio. Used in AudioCLIP; p controls probability.

imagemaskbboxeskeypoints

Transpose

Transpose by swapping rows and columns (width/height swap). Supports image, mask, bboxes, keypoints, volume. Self-inverse; use inverse() for TTA.

imagemaskbboxeskeypoints

VerticalFlip

Flip the image upside down. Same size and layout; self-inverse. Use inverse() for TTA to restore predictions to original orientation.

imagemaskbboxeskeypoints

WaterRefraction

Simulate looking through water or wavy glass via sine-wave displacement maps. Params: amplitude_range, wavelength_range, num_waves_range, interpolation.

imagemaskbboxeskeypoints

XYMasking

Apply horizontal or vertical masking strips to simulate occlusion. Useful for spectrograms (spectral/frequency masking).

imagemaskbboxeskeypoints

3D Transforms

(7)

Transforms for volumetric data, commonly used in medical imaging.