Albumentations to Kornia Transform Mapping
On this page
- Migration Rules
- Color and Pixel Transforms
- Illumination, Weather, and Procedural Effects
- Geometric Transforms
- Dropout and Annotation-Aware Transforms
- Channel Notes
- Migration Example
- Benchmark Pages
This page maps Albumentations transforms to Kornia equivalents where Kornia has a direct benchmark implementation. The benchmark source of truth is benchmark/transforms/kornia_impl.py, with shared canonical parameters in benchmark/transforms/specs.py.
If the Kornia column is -, the benchmark has no direct Kornia implementation for that Albumentations transform. Kornia still has useful lower-level tensor and geometry APIs; the table is about direct augmentation primitives used by the benchmark.
Migration Rules
- Albumentations expects NumPy arrays, usually per sample as
H,W,C. - Kornia expects PyTorch tensors, usually batched as
B,C,H,W. - Kornia often exposes
same_on_batch,p_batch,align_corners,keepdim, and tensor interpolation settings. - Albumentations exposes target-aware behavior through
A.Compose. - RGB/color-space transforms are not arbitrary-channel transforms in either library.
Color and Pixel Transforms
| Albumentations transform | Kornia transform | Notes |
|---|---|---|
| ColorJitter | ColorJitter / ColorJiggle | Similar brightness, contrast, saturation, and hue concept. Defaults and color math differ. |
| AutoContrast | RandomAutoContrast | Albumentations adds normal pipeline probability and mask options where supported. |
| Blur | RandomBoxBlur | Kornia uses fixed kernel tuples; Albumentations uses blur_range. |
| RandomBrightnessContrast | RandomBrightness / RandomContrast | Kornia exposes brightness and contrast as separate transforms; Albumentations commonly combines them. |
| ChannelDropout | RandomChannelDropout | Both drop channels; verify semantics for non-RGB channel stacks. |
| ChannelShuffle | RandomChannelShuffle | Same idea. Only valid when channel order is exchangeable for your data. |
| CLAHE | RandomClahe | Defaults differ; Albumentations uses clip_limit and tile_grid_size. |
| Equalize | RandomEqualize | Albumentations exposes mode, by_channels, and mask parameters. |
| RandomGamma | RandomGamma | Kornia uses gamma as a float; Albumentations uses percentage-like gamma_range. |
| GaussianBlur | RandomGaussianBlur | Similar concept with different kernel/sigma parameterization. |
| GaussNoise | RandomGaussianNoise | Albumentations has dtype-aware scaling, ranges, and per-channel options. |
| ToGray | RandomGrayscale | Kornia is RGB-oriented; Albumentations has multiple grayscale methods and configurable output channels. |
| HueSaturationValue / ColorJitter | RandomHue / RandomSaturation | Kornia exposes hue and saturation separately; Albumentations offers HSV and jitter-style APIs. |
| InvertImg | RandomInvert | Albumentations determines max value from dtype. |
| ImageCompression | RandomJPEG | Albumentations supports JPEG and WebP. |
| MedianBlur | RandomMedianBlur | Albumentations enforces odd kernel sizes. |
| MotionBlur | RandomMotionBlur | Parameter ranges differ. |
| PlanckianJitter | RandomPlanckianJitter | Similar physics-based color-temperature concept. RGB-specific. |
| Posterize | RandomPosterize | Albumentations supports per-channel and ranged bit settings. |
| RGBShift / AdditiveNoise | RandomRGBShift | RGBShift is direct RGB-style behavior; AdditiveNoise is the broader noise primitive. |
| SaltAndPepper | RandomSaltAndPepperNoise | Similar salt-and-pepper corruption. |
| Sharpen | RandomSharpness | Different parameterization and implementation methods. |
| RandomSnow | RandomSnow | Albumentations exposes multiple snow methods and richer simulation controls. |
| Solarize | RandomSolarize | Threshold handling differs. |
| Normalize | Normalize | Albumentations normalizes arrays; Kornia normalizes tensors. |
| Erasing | RandomErasing | Albumentations adds mask fill and inpainting options. |
| Colorize | - | No direct Kornia benchmark implementation. |
| Dithering | - | No direct Kornia benchmark implementation. |
| Downscale | - | No direct Kornia benchmark implementation for downscale-upscale degradation. |
| PixelSpread | - | No direct Kornia benchmark implementation. |
| Emboss | - | No direct Kornia benchmark implementation. |
| ChromaticAberration | - | No direct Kornia benchmark implementation. |
| ISONoise | - | No direct Kornia benchmark implementation. |
| ShotNoise | - | No direct Kornia benchmark implementation. |
| MultiplicativeNoise | - | No direct Kornia benchmark implementation. |
| RandomToneCurve | - | No direct Kornia benchmark implementation. |
| RingingOvershoot | - | No direct Kornia benchmark implementation. |
| Spatter | - | No direct Kornia benchmark implementation. |
| UnsharpMask | - | No direct Kornia benchmark implementation. |
| FancyPCA | - | No direct Kornia benchmark implementation. |
| Superpixels | - | No direct Kornia benchmark implementation. |
| ToSepia | - | No direct Kornia benchmark implementation. |
Illumination, Weather, and Procedural Effects
| Albumentations transform | Kornia transform | Notes |
|---|---|---|
| Illumination with linear mode | RandomLinearIllumination | Similar concept, different parameters. |
| Illumination with corner mode | RandomLinearCornerIllumination | Similar concept, different parameters. |
| Illumination with Gaussian mode | RandomGaussianIllumination | Similar concept, different parameters. |
| PlasmaBrightnessContrast | RandomPlasmaBrightness / RandomPlasmaContrast | Albumentations combines brightness and contrast variants. |
| PlasmaShadow | RandomPlasmaShadow | Similar fractal shadow concept. |
| RandomRain | RandomRain | Albumentations exposes slant, blur, brightness, and rain presets. |
| RandomFog | - | No direct Kornia benchmark implementation. |
| RandomShadow | - | No direct Kornia benchmark implementation. |
| RandomSunFlare | - | No direct Kornia benchmark implementation. |
| RandomGravel | - | No direct Kornia benchmark implementation. |
| AtmosphericFog | - | No direct Kornia benchmark implementation. |
| Vignetting | - | No direct Kornia benchmark implementation. |
| FilmGrain | - | No direct Kornia benchmark implementation. |
| Halftone | - | No direct Kornia benchmark implementation. |
| LensFlare | - | No direct Kornia benchmark implementation. |
| GridMask | - | No direct Kornia benchmark implementation. |
| WaterRefraction | - | No direct Kornia benchmark implementation. |
Geometric Transforms
| Albumentations transform | Kornia transform | Notes |
|---|---|---|
| Resize | Resize | Kornia works on tensors; Albumentations works on arrays and targets. |
| LongestMaxSize | LongestMaxSize | Aspect-ratio preserving resize by longest side. |
| SmallestMaxSize | SmallestMaxSize | Aspect-ratio preserving resize by shortest side. |
| CenterCrop | CenterCrop | Albumentations can pad small images and update targets. |
| RandomCrop | RandomCrop | Albumentations updates masks, boxes, and keypoints. |
| Affine | RandomAffine / RandomShear | Albumentations models shear as part of affine transformation. |
| ElasticTransform | RandomElasticTransform | Similar concept; parameterization differs. |
| OpticalDistortion | RandomFisheye | Similar fisheye goal, different distortion models and parameters. |
| HorizontalFlip | RandomHorizontalFlip | Albumentations updates supported targets; Kornia exposes batch controls. |
| Perspective | RandomPerspective | Kornia exposes align_corners and tensor settings; Albumentations exposes border/fill/mask behavior. |
| RandomResizedCrop | RandomResizedCrop | Similar policy with different implementation details. |
| RandomRotate90 | RandomRotation90 | Similar 90-degree rotation policy. |
| Rotate | RandomRotation | Albumentations has explicit bbox rotation options and crop behavior. |
| ThinPlateSpline | RandomThinPlateSpline | Similar smooth non-rigid deformation; control-point configuration differs. |
| VerticalFlip | RandomVerticalFlip | Albumentations updates supported targets; Kornia exposes batch controls. |
| Pad | - | No direct Kornia benchmark implementation. |
| PadIfNeeded | - | No direct Kornia benchmark implementation for padding to minimum size constraints. |
| SquareSymmetry | - | No direct Kornia benchmark implementation for the full 8-way square symmetry group. |
| Transpose | - | No direct Kornia benchmark implementation. |
| SafeRotate | - | No direct Kornia benchmark implementation for rotation that preserves full image content. |
| RandomScale | - | No direct Kornia benchmark implementation. |
| ShiftScaleRotate | - | No direct Kornia benchmark implementation for the combined augmentation primitive. |
| GridDistortion | - | No direct Kornia benchmark implementation for grid-based non-rigid distortion. |
| RandomGridShuffle | - | No direct Kornia benchmark implementation. |
| Morphological | - | No direct Kornia benchmark implementation for morphology operations. |
| CropAndPad | - | No direct Kornia benchmark implementation. |
| RandomSizedCrop | - | No direct Kornia benchmark implementation. |
Dropout and Annotation-Aware Transforms
| Albumentations transform | Kornia transform | Notes |
|---|---|---|
| CoarseDropout | - | No direct Kornia benchmark implementation for the Albumentations multi-hole dropout primitive. |
| GridDropout | - | No direct Kornia benchmark implementation. |
| PixelDropout | - | No direct Kornia benchmark implementation. |
| ConstrainedCoarseDropout | - | No direct Kornia benchmark implementation for object-constrained dropout. |
| CopyAndPaste | - | No direct Kornia benchmark implementation for annotation-aware copy-paste. |
Channel Notes
Kornia and Albumentations can both operate on non-RGB tensors/arrays for many channel-agnostic transforms. The trap is color semantics: RGBShift, HueSaturationValue, ColorJitter, PlanckianJitter, RandomRain, and RandomSnow are RGB/color transforms.
Blur, crop, resize, flip, affine, perspective, noise, dropout, and normalization are usually safer for arbitrary-channel data. For medical, hyperspectral, remote-sensing, or sensor-fusion inputs, document whether each channel is exchangeable, geometric-only, or color-like before choosing transforms.
Migration Example
import albumentations as A
pipeline = A.Compose([
A.HorizontalFlip(p=0.5),
A.Rotate(angle_range=(-15, 15), p=0.5),
A.GaussNoise(std_range=(0.05, 0.2), p=0.2),
])
For annotation-aware pipelines:
pipeline = A.Compose(
[
A.RandomCrop(height=512, width=512, p=1.0),
A.HorizontalFlip(p=0.5),
],
bbox_params=A.BboxParams(coord_format="pascal_voc", label_fields=["labels"]),
)