---
title: byteCountPerPixel
framework: accelerate
role: symbol
role_heading: Instance Property
path: accelerate/vimage/pixelbuffer/bytecountperpixel
---

# byteCountPerPixel

Returns the number of bytes per pixel.

## Declaration

```swift
var byteCountPerPixel: Int { get }
```

## Discussion

Discussion For example, the following code prints the number of bytes per pixel in two interleaved buffers:  let x = vImage.PixelBuffer<vImage.InterleavedFx2>(size: vImage.Size(width: 1,                                                                      height: 1))  let y = vImage.PixelBuffer<vImage.Interleaved8x4>(size: vImage.Size(width: 1,                                                                      height: 1))

// Prints "8 4".  print(x.byteCountPerPixel, y.byteCountPerPixel)

## See Also

### Inspecting a pixel buffer

- [width](accelerate/vimage/pixelbuffer/width.md)
- [height](accelerate/vimage/pixelbuffer/height.md)
- [size](accelerate/vimage/pixelbuffer/size.md)
- [channelCount](accelerate/vimage/pixelbuffer/channelcount.md)
- [rowStride](accelerate/vimage/pixelbuffer/rowstride.md)
- [count](accelerate/vimage/pixelbuffer/count.md)
- [array](accelerate/vimage/pixelbuffer/array.md)
