---
title: cropRect
framework: coreml
role: symbol
role_heading: Type Property
path: coreml/mlfeaturevalue/imageoption/croprect
---

# cropRect

The option you use to crop an image when creating an image feature value.

## Declaration

```swift
static let cropRect: MLFeatureValue.ImageOption
```

## Discussion

Discussion Use this value as a dictionary key for the options argument of an image-based MLFeatureValue initializer. Pair this key with a VNImageCropAndScaleOption value in the initializer’s options dictionary. For example, see init(CGImage:pixelsWide:pixelsHigh:pixelFormatType:options:).

## See Also

### Image options keys

- [cropAndScale](coreml/mlfeaturevalue/imageoption/cropandscale.md)
