---
title: "VTPixelTransferSessionTransferImage(_:from:to:)"
framework: videotoolbox
role: symbol
role_heading: Function
path: "videotoolbox/vtpixeltransfersessiontransferimage(_:from:to:)"
---

# VTPixelTransferSessionTransferImage(_:from:to:)

Copies and/or converts an image from one pixel buffer to another.

## Declaration

```swift
func VTPixelTransferSessionTransferImage(_ session: VTPixelTransferSession, from sourceBuffer: CVPixelBuffer, to destinationBuffer: CVPixelBuffer) -> OSStatus
```

## Parameters

- `session`: The pixel transfer session.
- `sourceBuffer`: The source buffer.
- `destinationBuffer`: The destination buffer.

## Return Value

Return Value noErr if successful or an error code, such as kVTPixelTransferNotSupportedErr, if the operation failed.

## Discussion

Discussion By default, the full width and height of sourceBuffer are scaled to the full width and height of destinationBuffer.   By default, all existing attachments on destinationBuffer are removed and new attachments are set that describe the transferred image.  Unrecognized attachments on sourceBuffer are propagated to destinationBuffer. Some properties modify this behavior; see VTPixelTransferProperties.h for more details.
