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

# unsharpMask()

Increases an image’s contrast between two colors.

## Declaration

```swift
class func unsharpMask() -> any CIFilter & CIUnsharpMask
```

## Return Value

Return Value The modified image.

## Discussion

Discussion This method applies the unsharp mask filter to an image. The effect increases the contrast of the edge between pixels of different colors within the defined radius property. The unsharp mask filter uses the following properties: The following code creates a filter that results in the objects within the image becoming darker: func unsharp (inputImage: CIImage) -> CIImage? {         let unsharpMask = CIFilter.unsharpMask()     unsharpMask.inputImage = inputImage     unsharpMask.radius = 5     unsharpMask.intensity = 2.5     return unsharpMask.outputImage! }

## See Also

### Filters

- [sharpenLuminance()](coreimage/cifilter-swift.class/sharpenluminance().md)
