<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/Transcript/ImageAttachment",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels10TranscriptV15ImageAttachmentV"
  },
  "title" : "Transcript.ImageAttachment"
}
-->

# Transcript.ImageAttachment

An image attachment in a transcript entry.

```
struct ImageAttachment
```

## Topics

### Creating an image attachment

[`init(_:orientation:)`](/documentation/FoundationModels/Transcript/ImageAttachment/init(_:orientation:))

Creates an image attachment from a Core Graphics image.

[`init(imageURL: URL, orientation: CGImagePropertyOrientation?)`](/documentation/FoundationModels/Transcript/ImageAttachment/init(imageURL:orientation:))

Creates an image attachment from a file URL pointing to an image.

### Inspecting an image attachment

[`var cgImage: CGImage`](/documentation/FoundationModels/Transcript/ImageAttachment/cgImage)

The image as a Core Graphics image.

[`var ciImage: CIImage`](/documentation/FoundationModels/Transcript/ImageAttachment/ciImage)

The image as a Core Image image.

[`var orientation: CGImagePropertyOrientation`](/documentation/FoundationModels/Transcript/ImageAttachment/orientation)

The display orientation of the image.

[`var url: URL?`](/documentation/FoundationModels/Transcript/ImageAttachment/url)

The URL of the original image asset, if the attachment was created from a URL.

### Getting the pixel buffer

[`func pixelBuffer(resolution: CGSize?, pixelFormat: OSType?) throws -> CVReadOnlyPixelBuffer`](/documentation/FoundationModels/Transcript/ImageAttachment/pixelBuffer(resolution:pixelFormat:))

Returns the image as a pixel buffer, optionally resampled to a given resolution and pixel format.

## Relationships

### Conforms To

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

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

[`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)