---
title: "init(commandBuffer:imageDescriptor:)"
framework: metalperformanceshaders
role: symbol
role_heading: Initializer
path: "metalperformanceshaders/mpstemporaryimage/init(commandbuffer:imagedescriptor:)"
---

# init(commandBuffer:imageDescriptor:)

Initializes a temporary image for use on a command buffer.

## Declaration

```swift
convenience init(commandBuffer: any MTLCommandBuffer, imageDescriptor: MPSImageDescriptor)
```

## Parameters

- `commandBuffer`: The command buffer on which the temporary image will be exclusively used.
- `imageDescriptor`: An image descriptor that describes the image to create.

## Return Value

Return Value A valid MPSTemporaryImage object.

## Discussion

Discussion The temporary image will be released when the command buffer is committed. The underlying texture will become invalid before this time due to the action of the readCount property.

## See Also

### Initializers

- [MPSImageDescriptor](metalperformanceshaders/mpsimagedescriptor.md)
- [init(commandBuffer:textureDescriptor:)](metalperformanceshaders/mpstemporaryimage/init(commandbuffer:texturedescriptor:).md)
- [MTLTextureDescriptor](metal/mtltexturedescriptor.md)
- [init(commandBuffer:textureDescriptor:featureChannels:)](metalperformanceshaders/mpstemporaryimage/init(commandbuffer:texturedescriptor:featurechannels:).md)
