<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSImageHistogramInfo/numberOfHistogramEntries",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:@SA@MPSImageHistogramInfo@FI@numberOfHistogramEntries"
  },
  "title" : "numberOfHistogramEntries"
}
-->

# numberOfHistogramEntries

Specifies the number of histogram entries (*bins*) for each channel.

```
var numberOfHistogramEntries: Int
```

## Discussion

This value must be both a power of 2 and a minimum of 256 bins.

For example, if you want 256 histogram bins then this value must be set to 256. The value stored in each histogram bin is a 32-bit unsigned integer. The size of the histogram buffer in which these bins will be stored should be more than or equal to:

`number of histogram entries * sizeof(uint32_t) * number of channels in the image`

---

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)