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

# stretchCrop()

Distorts an image by stretching or cropping to fit a specified size.

## Declaration

```swift
class func stretchCrop() -> any CIFilter & CIStretchCrop
```

## Return Value

Return Value The distorted image.

## Discussion

Discussion This method applies the stretch crop filter to an image. This effect distorts an image by stretching an image and then applies the crop extent. If the crop value is 0, the filter only uses stretching. If the value is 1, then the filter only uses cropping. The stretch crop filter uses the following properties: The following code creates a filter that results in a smaller image that’s distorted and cropped to be the defined size: func stretchCrop(inputImage: CIImage) -> CIImage {     let filter = CIFilter.stretchCrop()     filter.inputImage = inputImage     filter.cropAmount = 0.25     filter.centerStretchAmount = 0.25     filter.size = CGPoint(         x: inputImage.extent.width * 2,         y: inputImage.extent.size.height * 0.8     )     return filter.outputImage! }

## See Also

### Filters

- [bumpDistortion()](coreimage/cifilter-swift.class/bumpdistortion().md)
- [bumpDistortionLinear()](coreimage/cifilter-swift.class/bumpdistortionlinear().md)
- [circleSplashDistortion()](coreimage/cifilter-swift.class/circlesplashdistortion().md)
- [circularWrap()](coreimage/cifilter-swift.class/circularwrap().md)
- [displacementDistortion()](coreimage/cifilter-swift.class/displacementdistortion().md)
- [droste()](coreimage/cifilter-swift.class/droste().md)
- [glassDistortion()](coreimage/cifilter-swift.class/glassdistortion().md)
- [glassLozenge()](coreimage/cifilter-swift.class/glasslozenge().md)
- [holeDistortion()](coreimage/cifilter-swift.class/holedistortion().md)
- [lightTunnel()](coreimage/cifilter-swift.class/lighttunnel().md)
- [ninePartStretched()](coreimage/cifilter-swift.class/ninepartstretched().md)
- [ninePartTiled()](coreimage/cifilter-swift.class/nineparttiled().md)
- [pinchDistortion()](coreimage/cifilter-swift.class/pinchdistortion().md)
- [torusLensDistortion()](coreimage/cifilter-swift.class/toruslensdistortion().md)
- [twirlDistortion()](coreimage/cifilter-swift.class/twirldistortion().md)
