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

# spotLight()

Highlights a definined area of the image.

```
class func spotLight() -> any CIFilter & CISpotLight
```

## Return Value

The modified image.

## Discussion

This method applies the spotlight filter to an image. The effect applies a directional spotlight effect to an image while creating a transparent area not highlighted by the spotlight.

The spotlight filter uses the following properties:

- `inputImage`: An image with the type [`CIImage`](/documentation/CoreImage/CIImage).
- `lightPointsAt`: A [`CIVector`](/documentation/CoreImage/CIVector) with the x and y positions that the spotlight points at.
- `brightness`: A `float` representing the brightness of the spotlight as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `lightPosition`: A [`CIVector`](/documentation/CoreImage/CIVector) containing the x and y position of the spotlight.
- `concentration`: A `float` representing the size of the spotlight in pixels as an <doc://com.apple.documentation/documentation/Foundation/NSNumber>.
- `color`: A [`CIColor`](/documentation/CoreImage/CIColor) representing the spotlight color.

The following code creates a filter that results in only the bottom left of the image becoming visible while the rest of the image gradually becomes transparent:

```swift
func spotlight(inputImage: CIImage) -> CIImage {
    let spotlightFilter = CIFilter.spotLight()
    spotlightFilter.inputImage = inputImage
    spotlightFilter.lightPointsAt = CIVector(x: 100, y: 100)
    spotlightFilter.brightness = 10
    spotlightFilter.lightPosition = CIVector(x: 100, y: 100)
    spotlightFilter.concentration = 20
    return spotlightFilter.outputImage!
}
```

![Two pictures of a large amount of colorful  flowers. The photo on the left shows a group of flowers, in focus, with good light and no effects. In the photo on the right a spotlight  filter is applied, resulting in the photo becoming transparent with the bottom left corner being the most visible glimpse of the original image.](images/com.apple.coreimage/media-3600004@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)