<!--
{
  "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/Subject",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "VisionKit"
    ],
    "preciseIdentifier" : "s:9VisionKit24ImageAnalysisInteractionC7SubjectV"
  },
  "title" : "ImageAnalysisInteraction.Subject"
}
-->

# ImageAnalysisInteraction.Subject

An area of interest in an image that the framework identifies as a primary focal point.

```
struct Subject
```

## Overview

A *subject* is a foreground object in an image.
A single image can have multiple subjects. For example, in an image of three different coffee mugs, the framework may classify all three mugs as separate subjects.
In cases where the framework can’t separate overlapping objects in a photo as individual subjects, a subject may consist of two or more objects.

VisionKit enables your app to extract, or *lift*, the image subjects individually, or together, with the background removed. For more information, see [`image`](/documentation/VisionKit/ImageAnalysisInteraction/Subject/image).

An [`ImageAnalysisInteraction`](/documentation/VisionKit/ImageAnalysisInteraction) object contains an array of subjects ([`subjects`](/documentation/VisionKit/ImageAnalysisInteraction/subjects)) that activates when [`preferredInteractionTypes`](/documentation/VisionKit/ImageAnalysisInteraction/preferredInteractionTypes) contains a subject-related option, such as [`automatic`](/documentation/VisionKit/ImageAnalysisInteraction/InteractionTypes/automatic), or [`imageSubject`](/documentation/VisionKit/ImageAnalysisInteraction/InteractionTypes/imageSubject).

Your app can also present a button that gives more information on an image’s subjects by enabling the [`visualLookUp`](/documentation/VisionKit/ImageAnalysisInteraction/InteractionTypes/visualLookUp) interaction type.

## Topics

### Acquiring the subject image

[`var image: UIImage`](/documentation/VisionKit/ImageAnalysisInteraction/Subject/image)

An image of the subjects with the background removed.

### Locating and sizing the subject

[`var bounds: CGRect`](/documentation/VisionKit/ImageAnalysisInteraction/Subject/bounds)

A rectangle that identifies the extremities of a subject within an image in relation to the interaction view’s bounds.

### Serializing a subject

[`func hash(into: inout Hasher)`](/documentation/VisionKit/ImageAnalysisInteraction/Subject/hash(into:))

Serializes a subject with the given hasher.

## Relationships

### Conforms To

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

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

---

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)