<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetImageGenerator",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetImageGenerator"
  },
  "title" : "AVAssetImageGenerator"
}
-->

# AVAssetImageGenerator

An object that generates images from a video asset.

```
class AVAssetImageGenerator
```

## Overview

Use an image generator to extract images from a video asset at particular times within its timeline.

## Topics

### Creating an image generator

[`+  assetImageGeneratorWithAsset:`](/documentation/AVFoundation/AVAssetImageGenerator/assetImageGeneratorWithAsset:)

Returns a new object that generates images for times within a video asset.

[`-  initWithAsset:`](/documentation/AVFoundation/AVAssetImageGenerator/init(asset:))

Creates an object that generates images for times within a video asset.

### Configuring image generation

[`maximumSize`](/documentation/AVFoundation/AVAssetImageGenerator/maximumSize)

The maximum size of images to generate.

[`requestedTimeToleranceBefore`](/documentation/AVFoundation/AVAssetImageGenerator/requestedTimeToleranceBefore)

A maximum length of time before the requested time to allow image generation to occur.

[`requestedTimeToleranceAfter`](/documentation/AVFoundation/AVAssetImageGenerator/requestedTimeToleranceAfter)

A maximum length of time after the requested time to allow image generation to occur.

[`dynamicRangePolicy`](/documentation/AVFoundation/AVAssetImageGenerator/dynamicRangePolicy-swift.property)

The dynamic range policy to use when generating images.

[`DynamicRangePolicy`](/documentation/AVFoundation/AVAssetImageGenerator/DynamicRangePolicy-swift.struct)

A type that specifies the dynamic range policy to apply when generating images.

[`appliesPreferredTrackTransform`](/documentation/AVFoundation/AVAssetImageGenerator/appliesPreferredTrackTransform)

A Boolean value that specifies whether to apply the track matrix or matrices when generating an image from the asset.

[`apertureMode`](/documentation/AVFoundation/AVAssetImageGenerator/apertureMode-swift.property)

Specifies the aperture mode for the generated image.

[`ApertureMode`](/documentation/AVFoundation/AVAssetImageGenerator/ApertureMode-swift.struct)

Constants that define aperture modes to use when generating images.

### Configuring compositing

[`videoComposition`](/documentation/AVFoundation/AVAssetImageGenerator/videoComposition)

A video composition to use when extracting images from assets with multiple video tracks.

[`customVideoCompositor`](/documentation/AVFoundation/AVAssetImageGenerator/customVideoCompositor)

A custom video compositor to use when extracting images from assets with multiple video tracks.

### Generating images

[`image(at:)`](/documentation/AVFoundation/AVAssetImageGenerator/image(at:))

Generates an image for a requested time.

[`images(for:)`](/documentation/AVFoundation/AVAssetImageGenerator/images(for:))

Generates images for times within the video timeline.

[`Images`](/documentation/AVFoundation/AVAssetImageGenerator/Images)

An asynchronous sequence of images created by an image generator.

[`-  generateCGImageAsynchronouslyForTime:completionHandler:`](/documentation/AVFoundation/AVAssetImageGenerator/generateCGImageAsynchronously(for:completionHandler:))

Generates an image asynchronously for a requested time, and returns the result in a callback.

[`-  generateCGImagesAsynchronouslyForTimes:completionHandler:`](/documentation/AVFoundation/AVAssetImageGenerator/generateCGImagesAsynchronously(forTimes:completionHandler:))

Generates images asynchronously for an array of requested times, and returns the results in a callback.

[`AVAssetImageGeneratorCompletionHandler`](/documentation/AVFoundation/AVAssetImageGeneratorCompletionHandler)

A type alias for a closure that provides the result of an image generation request.

[`-  cancelAllCGImageGeneration`](/documentation/AVFoundation/AVAssetImageGenerator/cancelAllCGImageGeneration())

Cancels all pending image generation requests.

[`-  copyCGImageAtTime:actualTime:error:`](/documentation/AVFoundation/AVAssetImageGenerator/copyCGImage(at:actualTime:))

Returns an image for the asset at or near a specified time.

### Accessing the asset

[`asset`](/documentation/AVFoundation/AVAssetImageGenerator/asset)

The asset that initialized the image generator.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

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

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)