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

# retagging(with:)

Changes the color space tag of the bitmap image representation.

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

## Parameters

`newSpace`

The desired color space.

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

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

---

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)