<!--
{
  "availability" : [
    "iOS: 8.0.0 - 26.0.0",
    "iPadOS: 8.0.0 - 26.0.0",
    "macCatalyst: 13.1.0 - 26.0.0",
    "macOS: 10.8.0 - 26.0.0",
    "tvOS: 9.0.0 - 26.0.0",
    "visionOS: 1.0.0 - 26.0.0",
    "watchOS: 3.0.0 - 26.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SceneKit",
  "identifier" : "/documentation/SceneKit/SCNSceneExportDelegate/write(_:withSceneDocumentURL:originalImageURL:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SceneKit"
    ],
    "preciseIdentifier" : "c:objc(pl)SCNSceneExportDelegate(im)writeImage:withSceneDocumentURL:originalImageURL:"
  },
  "title" : "write(_:withSceneDocumentURL:originalImageURL:)"
}
-->

# write(_:withSceneDocumentURL:originalImageURL:)

Tells the delegate to export an image attached to a scene.

```
optional func write(_ image: UIImage, withSceneDocumentURL documentURL: URL, originalImageURL: URL?) -> URL?
```

## Parameters

`image`

An image attached to the scene being exported.

`documentURL`

The URL the scene is being exported to.

`originalImageURL`

The URL the image was originally loaded from, or `nil` if the image was not previously loaded from a URL.

## Return Value

The URL your app exported the image to, or `nil` if your app did not write the image to a URL.

## Discussion

If you implement this method, Scene Kit calls it for each image (for example, a texture) attached to the scene. Your app can then save the image data in a location and format of your choice, returning a URL for the exported image file.

If you do not provide a delegate when exporting a scene, or if your delegate returns `nil` from this method, Scene Kit exports the image in a default format to a default location.

---

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)