<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ImageIO",
  "identifier" : "/documentation/ImageIO/CGImageSourceCreateThumbnailAtIndex(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@F@CGImageSourceCreateThumbnailAtIndex"
  },
  "title" : "CGImageSourceCreateThumbnailAtIndex(_:_:_:)"
}
-->

# CGImageSourceCreateThumbnailAtIndex(_:_:_:)

Creates a thumbnail version of the image at the specified index in an image source.

```
func CGImageSourceCreateThumbnailAtIndex(_ isrc: CGImageSource, _ index: Int, _ options: CFDictionary?) -> CGImage?
```

## Parameters

`isrc`

The image source that contains the image data.

`index`

The zero-based index of the image you want. If the index is invalid, this method returns `NULL`.

`options`

A dictionary that specifies additional creation options. For a list of possible values, see [`Specifying the Read Options`](/documentation/ImageIO/CGImageSource#Specifying-the-Read-Options).

## Return Value

The image at the specified index, or `NULL` if an error occurs. You are responsible for releasing the returned object using <doc://com.apple.documentation/documentation/CoreGraphics/CGImageRelease>.

## Discussion

If the image source is a PDF, this function creates a 72 dpi image of the PDF page specified by the index that you pass. You must, however, pass an options dictionary that contains either the [`kCGImageSourceCreateThumbnailFromImageIfAbsent`](/documentation/ImageIO/kCGImageSourceCreateThumbnailFromImageIfAbsent) or [`kCGImageSourceCreateThumbnailFromImageAlways`](/documentation/ImageIO/kCGImageSourceCreateThumbnailFromImageAlways) keys, with the value of the key set to `true`.

---

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)