<!--
{
  "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/MultiplePlanePixelFormat",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate24MultiplePlanePixelFormatP"
  },
  "title" : "MultiplePlanePixelFormat"
}
-->

# MultiplePlanePixelFormat

A pixel format that contains multiple homogeneous planes represented by multiple underlying vImage buffers.

```
protocol MultiplePlanePixelFormat : PixelFormat
```

## Overview

Use multiple-plane pixel buffers to store image data as discrete planar buffers that represent individual channels.

For example, the following code deinterleaves an interleaved buffer and applies different gamma adjustments to different color channels. The code calls `PixelBuffer.convert(to:)` to reinterleave the image data and generates a <doc://com.apple.documentation/documentation/CoreGraphics/CGImage> instance of the final output.

```swift
let srcImage =  imageLiteral(resourceName: "...").cgImage(
    forProposedRect: nil,
    context: nil,
    hints: nil)!

var cgImageFormat = vImage_CGImageFormat(
    bitsPerComponent: 8,
    bitsPerPixel: 8 * 3,
    colorSpace: CGColorSpaceCreateDeviceRGB(),
    bitmapInfo: CGBitmapInfo(rawValue: CGImageAlphaInfo.none.rawValue))!

let interleaved = try vImage.PixelBuffer(
    cgImage: srcImage,
    cgImageFormat: &cgImageFormat,
    pixelFormat: vImage.Interleaved8x3.self)

let multiplane = vImage.PixelBuffer<vImage.Planar8x3>(interleavedBuffer: interleaved)

multiplane.withUnsafePixelBuffers { pixelBuffers in

    // Apply gamma to red channel.
    pixelBuffers[0].applyGamma(.nineOverElevenHalfPrecision,
                               destination: pixelBuffers[0])

    // Apply gamma to green channel.
    pixelBuffers[1].applyGamma(.fiveOverElevenHalfPrecision,
                               destination: pixelBuffers[1])
}

multiplane.convert(to: interleaved)
let outputImage = interleaved
```

## Topics

### Associated Types

[`associatedtype PlanarPixelFormat : StaticPixelFormat`](/documentation/Accelerate/MultiplePlanePixelFormat/PlanarPixelFormat)

### Type Properties

[`static var bitCountPerPlanarPixel: Int`](/documentation/Accelerate/MultiplePlanePixelFormat/bitCountPerPlanarPixel)

[`static var planeCount: Int`](/documentation/Accelerate/MultiplePlanePixelFormat/planeCount)

## Relationships

### Conforming Types

[`PlanarFx3`](/documentation/Accelerate/vImage/PlanarFx3)

[`PlanarFx4`](/documentation/Accelerate/vImage/PlanarFx4)

[`Planar8x2`](/documentation/Accelerate/vImage/Planar8x2)

[`Planar8x4`](/documentation/Accelerate/vImage/Planar8x4)

[`PlanarFx2`](/documentation/Accelerate/vImage/PlanarFx2)

[`Planar8x3`](/documentation/Accelerate/vImage/Planar8x3)

### Inherits From

[`PixelFormat`](/documentation/Accelerate/PixelFormat)

---

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)