<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIFilter-swift.class/ninePartStretched()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)ninePartStretchedFilter"
  },
  "title" : "ninePartStretched()"
}
-->

# ninePartStretched()

Distorts an image by stretching it between two breakpoints.

```
class func ninePartStretched() -> any CIFilter & CINinePartStretched
```

## Return Value

The distorted image.

## Discussion

This method applies the nine-part stretched filter to an image. This effect distorts an image by stretching an image to the breakpoint properties while distorting the image based on the grow amount.

The nine-part stretched filter uses the following properties:

- `inputImage`: An image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `growAmount`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the amount of stretching applied.
- `breakpoint0`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the lower-left corner of the image to retain before stretching begins.
- `breakpoint1`: A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> representing the upper-right corner of the image to retain after stretching ends.

The following code creates a filter that results in a significantly warped image:

```swift
func ninePartStretch(inputImage: CIImage) -> CIImage {
    let filter = CIFilter.ninePartStretched()
    filter.inputImage = inputImage
    filter.setDefaults()
    filter.breakpoint0 = CGPoint(x: 200, y: 200)
    filter.breakpoint1 = CGPoint(x: inputImage.extent.size.width-200, y: inputImage.extent.size.height - 200)
    filter.growAmount = CGPoint(x: 500, y: 500)
    return filter.outputImage!
}
```

![Two images arranged horizontally. The left image contains a photograph of three hydrangea flowers with dark leaves in the background. An area inset by 200 pixels from all sides is highlighted using a rectangle. The image on the right shows the result of applying the nine part stretched filter. The area within the red rectangle has been stretched making the image larger. The areas outside of the rectangle have been warped to match the stretched area.](images/com.apple.coreimage/media-4407340@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)