---
title: "retagging(with:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsbitmapimagerep/retagging(with:)"
---

# retagging(with:)

Changes the color space tag of the bitmap image representation.

## Declaration

```swift
func retagging(with newSpace: NSColorSpace) -> NSBitmapImageRep?
```

## Parameters

- `newSpace`: The desired color space.

## 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.

## Discussion

Discussion This method will definitely fail if you pass a color space that has a different color space model than the receiver. That is, if your original image is sRGB, you can only retag with some other RGB colorspace.

## See Also

### Managing Color Spaces

- [converting(to:renderingIntent:)](appkit/nsbitmapimagerep/converting(to:renderingintent:).md)
- [colorSpace](appkit/nsbitmapimagerep/colorspace.md)
