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

# perspectiveTransform()

Alters an image’s geometry to adjust the perspective.

## Declaration

```swift
class func perspectiveTransform() -> any CIFilter & CIPerspectiveTransform
```

## Return Value

Return Value The adjusted image.

## Discussion

Discussion This method applies the perspective transform filter to an image. The effect alters the geometry of an image to simulate the observer changing viewing position. You can use the perspective filter to skew an image. The perspective transform filter uses the following properties: The following code creates a filter that changes the perspective of the input image: func perspectiveTransform(inputImage: CIImage) -> CIImage {     let perspectiveTransformFilter = CIFilter.perspectiveTransform()     perspectiveTransformFilter.inputImage = inputImage     perspectiveTransformFilter.topLeft = CGPoint(x: 100, y: 3984)     perspectiveTransformFilter.topRight = CGPoint(x: 3732, y: 3025)     perspectiveTransformFilter.bottomLeft = CGPoint(x: 0, y: 500)     perspectiveTransformFilter.bottomRight = CGPoint(x: 4032, y: 120)     return perspectiveTransformFilter.outputImage! }

## See Also

### Filters

- [bicubicScaleTransform()](coreimage/cifilter-swift.class/bicubicscaletransform().md)
- [edgePreserveUpsample()](coreimage/cifilter-swift.class/edgepreserveupsample().md)
- [keystoneCorrectionCombined()](coreimage/cifilter-swift.class/keystonecorrectioncombined().md)
- [keystoneCorrectionHorizontal()](coreimage/cifilter-swift.class/keystonecorrectionhorizontal().md)
- [keystoneCorrectionVertical()](coreimage/cifilter-swift.class/keystonecorrectionvertical().md)
- [lanczosScaleTransform()](coreimage/cifilter-swift.class/lanczosscaletransform().md)
- [perspectiveCorrection()](coreimage/cifilter-swift.class/perspectivecorrection().md)
- [perspectiveRotate()](coreimage/cifilter-swift.class/perspectiverotate().md)
- [perspectiveTransformWithExtent()](coreimage/cifilter-swift.class/perspectivetransformwithextent().md)
- [straighten()](coreimage/cifilter-swift.class/straighten().md)
