---
title: "makeCGImage(cgImageFormat:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/makecgimage(cgimageformat:)"
---

# makeCGImage(cgImageFormat:)

Returns a Core Graphics image from the pixel buffer’s contents.

## Declaration

```swift
func makeCGImage(cgImageFormat: vImage_CGImageFormat) -> CGImage?
```

## Parameters

- `cgImageFormat`: The Core Graphics format of the source buffer.

## Mentioned in

Converting bitmap data between Core Graphics images and vImage buffers Applying flood fills to an image Optimizing image-processing performance

## Return Value

Return Value A Core Graphics image that contains the source buffer’s contents.

## See Also

### Pixel buffer methods

- [copy(to:)](accelerate/vimage/pixelbuffer/copy(to:).md)
- [copy(to:cvImageFormat:cgImageFormat:)](accelerate/vimage/pixelbuffer/copy(to:cvimageformat:cgimageformat:).md)
- [withCVPixelBuffer(readOnly:body:)](accelerate/vimage/pixelbuffer/withcvpixelbuffer(readonly:body:).md)
