---
title: MultiplePlanePixelFormat
framework: accelerate
role: symbol
role_heading: Protocol
path: accelerate/multipleplanepixelformat
---

# MultiplePlanePixelFormat

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

## Declaration

```swift
protocol MultiplePlanePixelFormat : PixelFormat
```

## Overview

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 CGImage instance of the final output. 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

- [PlanarPixelFormat](accelerate/multipleplanepixelformat/planarpixelformat.md)

### Type Properties

- [bitCountPerPlanarPixel](accelerate/multipleplanepixelformat/bitcountperplanarpixel.md)
- [planeCount](accelerate/multipleplanepixelformat/planecount.md)

## Relationships

### Inherits From

- [PixelFormat](accelerate/pixelformat.md)

### Conforming Types

- [vImage.Planar8x2](accelerate/vimage/planar8x2.md)
- [vImage.Planar8x3](accelerate/vimage/planar8x3.md)
- [vImage.Planar8x4](accelerate/vimage/planar8x4.md)
- [vImage.PlanarFx2](accelerate/vimage/planarfx2.md)
- [vImage.PlanarFx3](accelerate/vimage/planarfx3.md)
- [vImage.PlanarFx4](accelerate/vimage/planarfx4.md)

## See Also

### Protocols

- [InitializableFromCGImage](accelerate/initializablefromcgimage.md)
- [PixelFormat](accelerate/pixelformat.md)
- [SinglePlanePixelFormat](accelerate/singleplanepixelformat.md)
- [StaticPixelFormat](accelerate/staticpixelformat.md)
