<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBitmapImageRep/value(forProperty:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBitmapImageRep(im)valueForProperty:"
  },
  "title" : "value(forProperty:)"
}
-->

# value(forProperty:)

Returns the value for the specified property.

```
func value(forProperty property: NSBitmapImageRep.PropertyKey) -> Any?
```

## Parameters

`property`

A string constant used as a key for an image property. These properties are described in [`NSBitmapImageRep.PropertyKey`](/documentation/AppKit/NSBitmapImageRep/PropertyKey).

## Return Value

A value specific to `property`, or `nil` if the property is not set for the bitmap.

## Discussion

Image properties can affect how an image is read in and saved to file. When retrieving the bitmap image properties defined in [`NSBitmapImageRep.PropertyKey`](/documentation/AppKit/NSBitmapImageRep/PropertyKey), be sure to check the return value of this method for a `nil` value. If a particular value is not set for the image, this method may return `nil`.

---

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)