---
title: "createCGImage(format:flags:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage_buffer/createcgimage(format:flags:)"
---

# createCGImage(format:flags:)

Creates a Core Graphics image from the vImage buffer.

## Declaration

```swift
func createCGImage(format: vImage_CGImageFormat, flags options: vImage.Options = .noFlags) throws -> CGImage
```

## Parameters

- `format`: The desired format.
- `options`: The options to use when performing the operation.

## Mentioned in

Creating a Core Graphics Image from a vImage Buffer

## Return Value

Return Value A Core Graphics image that represents the contents of the vImage buffer.

## See Also

### Consuming and producing Core Graphics images

- [init(cgImage:flags:)](accelerate/vimage_buffer/init(cgimage:flags:).md)
- [init(cgImage:format:flags:)](accelerate/vimage_buffer/init(cgimage:format:flags:).md)
