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

# applyingGainMap(_:)

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

```
func applyingGainMap(_ gainmap: CIImage) -> CIImage
```

## Return Value


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

## Discussion

The gain map image can be obtained by creating a [`CIImage`](/documentation/CoreImage/CIImage) instance from `NSURL`/`NSData`
and setting the [`auxiliaryHDRGainMap`](/documentation/CoreImage/CIImageOption/auxiliaryHDRGainMap) option set to `@YES`.

If the gain map [`CIImage`](/documentation/CoreImage/CIImage) instance doesn’t have the needed [`properties`](/documentation/CoreImage/CIImage/properties) metadata,
the received image will be returned as-is.

---

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)