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

# converting(to:renderingIntent:)

Converts the bitmap image representation to the specified color space.

```
func converting(to targetSpace: NSColorSpace, renderingIntent: NSColorRenderingIntent) -> NSBitmapImageRep?
```

## Parameters

`targetSpace`

The new color space.

`renderingIntent`

The rendering intent specifies how to handle colors that are not located within the target color space. The supported values are [`NSColorRenderingIntent`](/documentation/AppKit/NSColorRenderingIntent).

## Return Value

An [`NSBitmapImageRep`](/documentation/AppKit/NSBitmapImageRep), or `nil`, if the conversion fails. If the original [`NSBitmapImageRep`](/documentation/AppKit/NSBitmapImageRep) already uses that color space, it is 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)