---
title: convertRGBtoLab()
framework: coreimage
role: symbol
role_heading: Type Method
path: coreimage/cifilter-swift.class/convertrgbtolab()
---

# convertRGBtoLab()

Converts an image from RGB to CIELAB color space.

## Declaration

```swift
class func convertRGBtoLab() -> any CIFilter & CIConvertLab
```

## Return Value

Return Value The converted CIImage.

## Discussion

Discussion This filter converts an image from RGB to CIELAB color space. The CIELAB color space expresses color as three values: L* for the perceptual lightness, and a*b* for the colors red, green, blue, and yellow. The RGB color space expresses colors using the intensities of the three primary colors: red, green, and blue. The following code applies the convertRGBToLabFilter to an image with the normalize flag set to the true: func convertRGBToLab(inputImage: CIImage) -> CIImage {     let convertRGBToLabFilter = CIFilter.convertRGBtoLab()     convertRGBToLabFilter.inputImage = inputImage     convertRGBToLabFilter.normalize = true     return convertRGBToLabFilter.outputImage! }

## See Also

### Color Effect Filters

- [colorCrossPolynomial()](coreimage/cifilter-swift.class/colorcrosspolynomial().md)
- [colorCube()](coreimage/cifilter-swift.class/colorcube().md)
- [colorCubeWithColorSpace()](coreimage/cifilter-swift.class/colorcubewithcolorspace().md)
- [colorCubesMixedWithMask()](coreimage/cifilter-swift.class/colorcubesmixedwithmask().md)
- [colorCurves()](coreimage/cifilter-swift.class/colorcurves().md)
- [colorInvert()](coreimage/cifilter-swift.class/colorinvert().md)
- [colorMap()](coreimage/cifilter-swift.class/colormap().md)
- [colorMonochrome()](coreimage/cifilter-swift.class/colormonochrome().md)
- [colorPosterize()](coreimage/cifilter-swift.class/colorposterize().md)
- [convertLabToRGB()](coreimage/cifilter-swift.class/convertlabtorgb().md)
- [dither()](coreimage/cifilter-swift.class/dither().md)
- [documentEnhancer()](coreimage/cifilter-swift.class/documentenhancer().md)
- [falseColor()](coreimage/cifilter-swift.class/falsecolor().md)
- [labDeltaE()](coreimage/cifilter-swift.class/labdeltae().md)
- [maskToAlpha()](coreimage/cifilter-swift.class/masktoalpha().md)
