---
title: "write(to:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdltexture/write(to:)"
---

# write(to:)

Exports the texture data to an image file at the specified URL.

## Declaration

```swift
func write(to URL: URL) -> Bool
```

## Parameters

- `URL`: The file URL at which to write the texture image.

## Return Value

Return Value true if export succeeded; false otherwise.

## Discussion

Discussion Model I/O automatically infers the file format in which to export the image from the filename extension of the url parameter. This method can export textures in JPEG, TIFF, PNG, or (in macOS only) OpenEXR format.

## See Also

### Exporting Textures

- [write(to:type:)](modelio/mdltexture/write(to:type:).md)
- [imageFromTexture()](modelio/mdltexture/imagefromtexture().md)
