<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImage/contentHeadroom",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImage(py)contentHeadroom"
  },
  "title" : "contentHeadroom"
}
-->

# contentHeadroom

Returns the content headroom of the image.

```
var contentHeadroom: Float { get }
```

## Discussion

If the image headroom is unknown, then the value 0.0 will be returned.

If the image headroom is known, then a value greater than or equal to 1.0 will be returned.
A value of 1.0 will be returned if the image is SDR.
A value greater than 1.0 will be returned if the image is HDR.

The image headroom may known when a CIImage is first initialized.
If the a CIImage is initialized using:

- `NSURL` or `NSData` : the headroom may be determined by associated metadata
  or deduced from pixel format or colorSpace information.
- `CGImage` : headroom may be determined by `CGImageGetHeadroomInfo()`
  or deduced from pixel format or colorSpace information.
- `IOSurface` : then the headroom will be determined by `kIOSurfaceContentHeadroom`.
  or deduced from pixel format or colorSpace information.
- `CVPixelBuffer` : then the headroom will be determined by `kCVImageBufferContentLightLevelInfoKey`.
  or deduced from pixel format or colorSpace information.
- `BitmapData` : headroom may be deduced from pixel format or colorSpace information.

If the image is the result of applying a [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) or [`CIKernel`](/documentation/CoreImage/CIKernel), this method will return `0.0`.

There are exceptions to this.  Applying a `CIWarpKernel`` or certain ``CIFilter-class``  (e.g. `CIGaussianBlur`, `CILanczosScaleTransform`, `CIAreaAverage`and some others)  to an image will result in a ``CIImage`` instance with the same`contentHeadroom` property value.

---

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)