---
title: "init(mtlTexture:options:)"
framework: coreimage
role: symbol
role_heading: Initializer
path: "coreimage/ciimage/init(mtltexture:options:)-67uvj"
---

# init(mtlTexture:options:)

Initializes an image object with data supplied by a Metal texture.

## Declaration

```swift
init?(mtlTexture texture: any MTLTexture, options: [CIImageOption : Any]? = nil)
```

## Parameters

- `texture`: The Metal texture from which to use image data.
- `options`: A dictionary specifying image options. (See Image Dictionary Keys.)

## Return Value

Return Value The initialized image object, or nil if the image could not be initialized.

## Discussion

Discussion To render the image using Metal, use this image with a Metal-based CIContext object created with the init(mtlDevice:) method, and call the render(_:to:commandBuffer:bounds:colorSpace:) method to create an output image in another Metal texture object.

## See Also

### Creating an Image

- [empty()](coreimage/ciimage/empty().md)
- [init(image:)](coreimage/ciimage/init(image:).md)
- [init(image:options:)](coreimage/ciimage/init(image:options:).md)
- [init(contentsOf:)](coreimage/ciimage/init(contentsof:).md)
- [init(contentsOf:options:)](coreimage/ciimage/init(contentsof:options:).md)
- [init(cgImage:)](coreimage/ciimage/init(cgimage:)-2kvvb.md)
- [init(cgImage:options:)](coreimage/ciimage/init(cgimage:options:)-8663h.md)
- [init(cgImageSource:index:options:)](coreimage/ciimage/init(cgimagesource:index:options:)-e2bz.md)
- [init(data:)](coreimage/ciimage/init(data:).md)
- [init(data:options:)](coreimage/ciimage/init(data:options:).md)
- [init(bitmapData:bytesPerRow:size:format:colorSpace:)](coreimage/ciimage/init(bitmapdata:bytesperrow:size:format:colorspace:).md)
- [init(bitmapImageRep:)](coreimage/ciimage/init(bitmapimagerep:).md)
- [init(imageProvider:size:_:format:colorSpace:options:)](coreimage/ciimage/init(imageprovider:size:_:format:colorspace:options:).md)
- [init(depthData:)](coreimage/ciimage/init(depthdata:).md)
- [init(depthData:options:)](coreimage/ciimage/init(depthdata:options:).md)
