---
title: imageFromTexture()
framework: modelio
role: symbol
role_heading: Instance Method
path: modelio/mdltexture/imagefromtexture()
---

# imageFromTexture()

Exports the texture data as a CoreGraphics image.

## Declaration

```swift
func imageFromTexture() -> Unmanaged<CGImage>?
```

## Return Value

Return Value A CoreGraphics image object containing the texture’s pixel data, or nil if the texture data cannot be represented using CoreGraphics.

## See Also

### Exporting Textures

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