---
title: "encode(commandBuffer:sourceImage:destinationImage:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsunaryimagekernel/encode(commandbuffer:sourceimage:destinationimage:)"
---

# encode(commandBuffer:sourceImage:destinationImage:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, sourceImage: MPSImage, destinationImage: MPSImage)
```

## See Also

### Methods

- [encode(commandBuffer:inPlaceTexture:fallbackCopyAllocator:)](metalperformanceshaders/mpsunaryimagekernel/encode(commandbuffer:inplacetexture:fallbackcopyallocator:).md)
- [MPSCopyAllocator](metalperformanceshaders/mpscopyallocator.md)
- [encode(commandBuffer:sourceTexture:destinationTexture:)](metalperformanceshaders/mpsunaryimagekernel/encode(commandbuffer:sourcetexture:destinationtexture:).md)
- [sourceRegion(destinationSize:)](metalperformanceshaders/mpsunaryimagekernel/sourceregion(destinationsize:).md)
