<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/cropping-and-working-with-regions-of-interest",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Cropping and working with regions of interest"
}
-->

# Cropping and working with regions of interest

Crop images and apply operations to regions of interest.

## Topics

### Cropping

[`func crop(at: CGPoint, destination: vImage.PixelBuffer<Format>)`](/documentation/Accelerate/vImage/PixelBuffer/crop(at:destination:))

Crops the pixel buffer to a rectangle that’s defined by an origin and the destination buffer’s dimensions.

[`func cropped(to: CGRect) -> vImage.PixelBuffer<Format>`](/documentation/Accelerate/vImage/PixelBuffer/cropped(to:))

Returns a new pixel buffer that contains a copy of the data specified as a subregion of an existing pixel buffer.

### Region of Interest

[`func withUnsafeRegionOfInterest<R>(CGRect, (vImage.PixelBuffer<Format>) throws -> R) rethrows -> R`](/documentation/Accelerate/vImage/PixelBuffer/withUnsafeRegionOfInterest(_:_:))

Calls the given closure with a pixel buffer that references the image data within the specified region of interest.



---

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)