<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImage/PixelBuffer/permuteChannels(to:destination:)-4y4rh",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO11PixelBufferVAaC14Interleaved8x3VRszrlE15permuteChannels2to11destinationys5UInt8V_A2Lt_AEy_AGGtF"
  },
  "title" : "permuteChannels(to:destination:)"
}
-->

# permuteChannels(to:destination:)

Permutes the channels of an 8-bit-per-channel, 3-channel interleaved pixel buffer.

```
func permuteChannels(to permuteMap: (UInt8, UInt8, UInt8), destination: vImage.PixelBuffer<Format>)
```

## Parameters

`permuteMap`

A tuple of three 8-bit integers with the values 0, 1, and 2 in some order.

`destination`

The destination pixel buffer.

## Discussion

For example, the following code reverses the channel ordering of a pixel buffer:

```swift
let buffer = vImage.PixelBuffer<vImage.Interleaved8x3>(
    pixelValues: [10, 20, 30],
    size: vImage.Size(width: 1,
                      height: 1))

buffer.permuteChannels(to: (2, 1, 0),
                       destination: buffer)

// Prints "[30, 20, 10]".
print(buffer.array)
```

---

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)