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

# depthToDisparity()

Converts from an image containing depth data to an image containing disparity data.

## Declaration

```swift
class func depthToDisparity() -> any CIFilter & CIDepthToDisparity
```

## Return Value

Return Value An image containing the disparity data.

## Discussion

Discussion This method applies the depth-to-disparity filter. The filter takes depth data as an input and produces disparity data in the output image. You can use the output of this filter to create a stereo image. The depth-to-disparity filter uses the following property: The following code creates a filter that generates a depth map image: func depthToDisparity(inputImage: CIImage) -> CIImage {     let depthToDisparityFilter = CIFilter.depthToDisparity()     depthToDisparityFilter.inputImage = inputImage     return depthToDisparityFilter.outputImage! }

## See Also

### Filters

- [colorAbsoluteDifference()](coreimage/cifilter-swift.class/colorabsolutedifference().md)
- [colorClamp()](coreimage/cifilter-swift.class/colorclamp().md)
- [colorControls()](coreimage/cifilter-swift.class/colorcontrols().md)
- [colorMatrix()](coreimage/cifilter-swift.class/colormatrix().md)
- [colorPolynomial()](coreimage/cifilter-swift.class/colorpolynomial().md)
- [colorThreshold()](coreimage/cifilter-swift.class/colorthreshold().md)
- [colorThresholdOtsu()](coreimage/cifilter-swift.class/colorthresholdotsu().md)
- [disparityToDepth()](coreimage/cifilter-swift.class/disparitytodepth().md)
- [exposureAdjust()](coreimage/cifilter-swift.class/exposureadjust().md)
- [gammaAdjust()](coreimage/cifilter-swift.class/gammaadjust().md)
- [hueAdjust()](coreimage/cifilter-swift.class/hueadjust().md)
- [linearToSRGBToneCurve()](coreimage/cifilter-swift.class/lineartosrgbtonecurve().md)
- [sRGBToneCurveToLinear()](coreimage/cifilter-swift.class/srgbtonecurvetolinear().md)
- [temperatureAndTint()](coreimage/cifilter-swift.class/temperatureandtint().md)
- [toneCurve()](coreimage/cifilter-swift.class/tonecurve().md)
