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

# straighten()

Rotates and crops an image.

## Declaration

```swift
class func straighten() -> any CIFilter & CIStraighten
```

## Return Value

Return Value The adjusted image.

## Discussion

Discussion This method applies the straighten filter to an image. The effect rotates the image based on the angle property while cropping and scaling the image to remain the same size as the original image. The straighten filter uses the following properties: The following code creates a filter that rotates the image 135 degrees: func straighten(inputImage: CIImage) -> CIImage {     let straightenFilter = CIFilter.straighten()     straightenFilter.inputImage = inputImage     straightenFilter.angle = 135     return straightenFilter.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)
- [perspectiveTransform()](coreimage/cifilter-swift.class/perspectivetransform().md)
- [perspectiveTransformWithExtent()](coreimage/cifilter-swift.class/perspectivetransformwithextent().md)
