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

# edgePreserveUpsample()

Creates a high-quality upscaled image.

```
class func edgePreserveUpsample() -> any CIFilter & CIEdgePreserveUpsample
```

## Return Value

The adjusted image.

## Discussion

This method applies the edge preserve upsample filter to an image. The effect upsamples a small input image to be the size of the scale image using the luminance of the input image to preserve detail.

The edge preserve upsample filter uses the following properties:

- `inputImage`: An image representing the image to upscale with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `scaleImage`: An image representing the reference for scaling the input image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `spatialSigma`: A float representing the influence of the input image’s spatial information on the upsampling operation as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `lumaSimga`: A float representing influence of the input image’s luma information on the upsampling operation as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that upscales the smaller image to the size of the scale image:

```swift
func edgePerserveUp(inputImage: CIImage, smallImage: CIImage) -> CIImage {
    let edgePerserveUpFilter = CIFilter.edgePreserveUpsample()
    edgePerserveUpFilter.inputImage = inputImage
    edgePerserveUpFilter.smallImage = smallImage
    edgePerserveUpFilter.spatialSigma = 5
    edgePerserveUpFilter.lumaSigma = 0.15
    return edgePerserveUpFilter.outputImage!
}
```

![Two photographs of two large buildings with a clear sky in the background. The buildings have small windows with a lot of horizonal and vertical details. The photo on the left has no modifications to size or color. In the photo on the right, an edge preserve upsample filter is applied, resulting in a scaled-up, larger image.](images/com.apple.coreimage/media-3582220@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)