<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VisionKit",
  "identifier" : "/documentation/VisionKit/ImageAnalysisInteraction/image(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit24ImageAnalysisInteractionC5image3forSo7UIImageCShyAC7SubjectVG_tYaKF"
  },
  "title" : "image(for:)"
}
-->

# image(for:)

Provides an image asynchronously that contains the given subjects with the background removed.

```
@MainActor final func image(for subjects: Set<ImageAnalysisInteraction.Subject>) async throws -> UIImage
```

## Parameters

`subjects`

An array of subjects to include in the image.

## Discussion

If one or more subjects fail to produce an image, the method throws [`ImageAnalysisInteraction.SubjectUnavailable.imageUnavailable`](/documentation/VisionKit/ImageAnalysisInteraction/SubjectUnavailable/imageUnavailable).

---

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)