---
title: "converting(to:renderingIntent:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbitmapimagerep/converting(to:renderingintent:)"
---

# converting(to:renderingIntent:)

Converts the bitmap image representation to the specified color space.

## Declaration

```swift
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 doc://com.apple.appkit/documentation/AppKit/NSColorRenderingIntent.

## Return Value

Return Value An NSBitmapImageRep, or nil, if the conversion fails. If the original NSBitmapImageRep already uses that color space, it is returned as is.

## See Also

### Managing Color Spaces

- [retagging(with:)](appkit/nsbitmapimagerep/retagging(with:).md)
- [colorSpace](appkit/nsbitmapimagerep/colorspace.md)
