---
title: samplesPerPixel
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsbitmapimagerep/samplesperpixel
---

# samplesPerPixel

The number of components for each pixel.

## Declaration

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

## Discussion

Discussion This property reflects both the number of color components and the coverage component, if present.

## See Also

### Related Documentation

- [bitsPerSample](appkit/nsimagerep/bitspersample.md)

### Getting Information About Images

- [bitmapFormat](appkit/nsbitmapimagerep/bitmapformat.md)
- [NSBitmapImageRep.Format](appkit/nsbitmapimagerep/format.md)
- [bitsPerPixel](appkit/nsbitmapimagerep/bitsperpixel.md)
- [bytesPerPlane](appkit/nsbitmapimagerep/bytesperplane.md)
- [bytesPerRow](appkit/nsbitmapimagerep/bytesperrow.md)
- [isPlanar](appkit/nsbitmapimagerep/isplanar.md)
- [numberOfPlanes](appkit/nsbitmapimagerep/numberofplanes.md)
