<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImage/regionOfInterest(for:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImage(im)regionOfInterestForImage:inRect:"
  },
  "title" : "regionOfInterest(for:in:)"
}
-->

# regionOfInterest(for:in:)

Returns the region of interest for the filter chain that generates the image.

```
func regionOfInterest(for image: CIImage, in rect: CGRect) -> CGRect
```

## Parameters

`image`

Another image that is part of the filter chain that generates the image.

`rect`

A rectangle in the image’s coordinate space.

## Return Value

A rectangle in the coordinate space of the input image (the `im` parameter).

## Discussion

The region of interest is the rectangle containing pixel data in a source image (the `im` parameter) necessary to produce a corresponding rectangle in the output image. If the image is not the output of a filter (or of a chain or graph of several [`CIFilter`](/documentation/CoreImage/CIFilter-swift.class) objects), or the image in the `im` parameter is not an input to that filter, the rectangle returned is the same as that in the `r` parameter.

For example,

- If the image is the output of a filter that doubles the size of its input image, the rectangle returned will be half the size of that in the `r` parameter. (Upscaling causes every pixel in the input image to correspond to multiple pixels in the output image.)
- If the image is the output of a blur filter, the rectangle returned will be slightly larger than that in the `r` parameter. (In a blur filter, each pixel in the output image is produced using information from the corresponding pixel and those immediately surrounding it in the input image.)

---

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)