<!--
{
  "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/lineOverlay()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image",
      "CoreImage"
    ],
    "preciseIdentifier" : "c:objc(cs)CIFilter(cm)lineOverlayFilter"
  },
  "title" : "lineOverlay()"
}
-->

# lineOverlay()

Creates an image that resembles a sketch of the outlines of objects.

```
class func lineOverlay() -> any CIFilter & CILineOverlay
```

## Return Value

The modified image.

## Discussion

This method applies the line overlay filter to an image. The effect creats a sketch that outlines the edges of the image in black, leaving the non-outlined portion of the image transparent.

The line overlay filter uses the following properties:

- `inputImage`: An image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `nrNoiseLevel`: A `float` representing the desired level of noise as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `nrSharpness`: A `float` representing the desired level of sharpness as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `edgeIntensity`: A `float` representing the Sobel gradient information for edge tracing as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `threshold`: A `float` representing the threshold of edge visibilty as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `contrast`: A `float` representing the desired contrast as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.

The following code creates a filter that results in a monochrome image with lines outlining the edges of objects:

```swift
func lineOverlay(inputImage: CIImage) -> CIImage {
    let lineOverlay = CIFilter.lineOverlay()
    lineOverlay.inputImage = inputImage
    lineOverlay.nrNoiseLevel = 0.07
    lineOverlay.nrSharpness = 0.71
    lineOverlay.edgeIntensity = 1
    lineOverlay.threshold = 0.1
    lineOverlay.contrast = 50.00
    return lineOverlay.outputImage!
}
```

![Two pictures of a pink flower surrounded by foliage. The photo on the left shows a single flower photographed close up, in focus, with good light and no effects. In the photo on the right, the line overlay filter is applied, resulting in a monochrome image with the edges of objects outlined in black.](images/com.apple.coreimage/media-3600001@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)