<!--
{
  "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/CGImageDestinationAddImageFromSource(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Image I/O"
    ],
    "preciseIdentifier" : "c:@F@CGImageDestinationAddImageFromSource"
  },
  "title" : "CGImageDestinationAddImageFromSource(_:_:_:_:)"
}
-->

# CGImageDestinationAddImageFromSource(_:_:_:_:)

Adds an image from an image source to an image destination.

```
func CGImageDestinationAddImageFromSource(_ idst: CGImageDestination, _ isrc: CGImageSource, _ index: Int, _ properties: CFDictionary?)
```

## Parameters

`idst`

The image destination to modify.

`isrc`

An image source that contains the image.

`index`

The index of the image in the image source. Specify a valid, zero-based index into the images of the image source. If the index is invalid, this method returns `NULL`.

`properties`

An optional dictionary that specifies additional image property information. The added image automatically inherits the properties found in the image source. Use this dictionary to add properties to the image, or to modify one of the inherited properties. To remove an inherited property altogether, specify `NULL` for the property’s value. For a list of possible values, see [Image Properties](/documentation/ImageIO/image-properties) and <doc:CGImageDestination/Configuring-the-Image-Behaviors>.

## Discussion

---

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)