<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CreateMLComponents",
  "identifier" : "/documentation/CreateMLComponents/ImageCropper",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Create ML Components"
    ],
    "preciseIdentifier" : "s:18CreateMLComponents12ImageCropperV"
  },
  "title" : "ImageCropper"
}
-->

# ImageCropper

An image crop transformer.

```
struct ImageCropper
```

## Topics

### Creating the transformer

[`init(cropRectangle: CGRect)`](/documentation/CreateMLComponents/ImageCropper/init(cropRectangle:))

Creates an image crop transformer. This transformer is used to crop an image to the `cropRectangle`.

### Getting the properties

[`var cropRectangle: CGRect`](/documentation/CreateMLComponents/ImageCropper/cropRectangle)

The crop rectangle within the image bounds.

### Performing the transformation

[`func applied(to: CIImage, eventHandler: EventHandler?) throws -> CIImage`](/documentation/CreateMLComponents/ImageCropper/applied(to:eventHandler:))

Perform the image crop operation on the input pixelBuffer.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Transformer`](/documentation/CreateMLComponents/Transformer)

[`Escapable`](/documentation/Swift/Escapable)

[`Copyable`](/documentation/Swift/Copyable)

[`Encodable`](/documentation/Swift/Encodable)

[`Decodable`](/documentation/Swift/Decodable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)