<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/thresholding-and-clipping-pixel-buffer-values",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Thresholding and clipping pixel buffer values"
}
-->

# Thresholding and clipping pixel buffer values

Limit the values in a pixel buffer to a threshold or a range.

## Topics

### Clipping

[`func clip(to: ClosedRange<Float>, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/clip(to:destination:))

Clips the values of a 32-bit pixel buffer to the specified bounds.

### Threshold

[`func colorThreshold(Float, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/colorThreshold(_:destination:))

Creates a binary image from a 32-bit pixel buffer.



---

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)