<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSImage/bestRepresentationForDevice:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSImage(im)bestRepresentationForDevice:"
  },
  "title" : "bestRepresentationForDevice:"
}
-->

# bestRepresentationForDevice:

Returns the best representation for the device with the specified characteristics.

```
- (NSImageRep *) bestRepresentationForDevice:(NSDictionary *) deviceDescription;
```

## Parameters

`deviceDescription`

A dictionary of attributes for the specified device, or `nil` to specify the current device. For a list of dictionary keys and values appropriate to display and print devices, see the constants in [`NSScreen`](/documentation/AppKit/NSScreen).

## Return Value

The image representation that most closely matches the specified criteria.

## Discussion

If `deviceDescription` is `nil`, this method uses the attributes of the device on which the content is to be drawn.

## See Also

[`var isValid: Bool`](/documentation/AppKit/NSImage/isValid)

A Boolean value that indicates whether it is possible to draw an image representation.

[`var representations: [NSImageRep]`](/documentation/AppKit/NSImage/representations)

An array containing all of the image object’s image representations.

[`var matchesOnMultipleResolution: Bool`](/documentation/AppKit/NSImage/matchesOnMultipleResolution)

A Boolean value that indicates whether image representations whose resolution is an integral multiple of the device resolution are a match.

[`var prefersColorMatch: Bool`](/documentation/AppKit/NSImage/prefersColorMatch)

A Boolean value that indicates whether the image prefers to choose image representations using color-matching or resolution-matching.



---

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)