<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLFeatureValue/ImageOption/cropRect",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Core ML",
      "CoreML"
    ],
    "preciseIdentifier" : "c:@MLFeatureValueImageOptionCropRect"
  },
  "title" : "cropRect"
}
-->

# cropRect

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

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

## Discussion

Use this value as a dictionary key for the `options` argument of an image-based `MLFeatureValue` initializer. Pair this key with a <doc://com.apple.documentation/documentation/Vision/VNImageCropAndScaleOption> value in the initializer’s `options` dictionary. For example, see [`init(CGImage:pixelsWide:pixelsHigh:pixelFormatType:options:)`](/documentation/CoreML/MLFeatureValue/init(CGImage:pixelsWide:pixelsHigh:pixelFormatType:options:)-2zg43).

---

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)