<!--
{
  "availability" : [
    "iOS: 14.1.0 -",
    "iPadOS: 14.1.0 -",
    "macCatalyst: 14.1.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/kCGImageDestinationPreserveGainMap",
  "metadataVersion" : "0.1.0",
  "role" : "Global Variable",
  "symbol" : {
    "kind" : "Global Variable",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@kCGImageDestinationPreserveGainMap"
  },
  "title" : "kCGImageDestinationPreserveGainMap"
}
-->

# kCGImageDestinationPreserveGainMap

A Boolean value that indicates whether to include a HEIF-embedded gain map in the image data.

```
let kCGImageDestinationPreserveGainMap: CFString
```

## Discussion

The value of this key must be a <doc://com.apple.documentation/documentation/CoreFoundation/CFBoolean> value. The default value is <doc://com.apple.documentation/documentation/CoreFoundation/kCFBooleanFalse>. If you scale the destination image using the [`kCGImageDestinationImageMaxPixelSize`](/documentation/ImageIO/kCGImageDestinationImageMaxPixelSize) key, the destination also scales the gain map.

---

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)