<!--
{
  "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/applyingGainMap(_:headroom:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImage(im)imageByApplyingGainMap:headroom:"
  },
  "title" : "applyingGainMap(_:headroom:)"
}
-->

# applyingGainMap(_:headroom:)

Create an image that applies a gain map Core Image image with a specified headroom to the received Core Image image.

```
func applyingGainMap(_ gainmap: CIImage, headroom: Float) -> CIImage
```

## Parameters

`gainmap`

The gain map [`CIImage`](/documentation/CoreImage/CIImage) instance to apply to the receiver.

`headroom`

a float value that specify how much headroom the resulting image should have.
The headroom value will be limited to between 1.0 (i.e. SDR) and
the full headroom allowed by the gain map.

## Return Value


An autoreleased [`CIImage`](/documentation/CoreImage/CIImage) instance or the received image.

---

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)