---
title: Creating a Core Graphics Image from a vImage Buffer
framework: accelerate
role: article
role_heading: Article
path: accelerate/creating-a-core-graphics-image-from-a-vimage-buffer
---

# Creating a Core Graphics Image from a vImage Buffer

Create displayable representations of vImage buffers.

## Overview

Overview vImage provides a function for creating Core Graphics images from vImage buffers. This function allows you to display the results of a vImage operation to your user. Create the Image You create a Core Graphics image from the buffer, and initialize a UIImage instance from that. The createCGImage(format:flags:) function returns a CGImage instance based on the supplied Core Graphics image format (for more information, see Converting bitmap data between Core Graphics images and vImage buffers). The following example shows how to create a Core Graphics image from a vImage buffer: let result = try? destinationBuffer.createCGImage(format: format)

if let result = result {     // Assumes `imageView` is a `UIImageView`     imageView.image = UIImage(cgImage: result) }

## See Also

### Image Processing Essentials

- [Converting bitmap data between Core Graphics images and vImage buffers](accelerate/converting-bitmap-data-between-core-graphics-images-and-vimage-buffers.md)
- [Creating and Populating Buffers from Core Graphics Images](accelerate/creating-and-populating-buffers-from-core-graphics-images.md)
- [Building a Basic Image-Processing Workflow](accelerate/building-a-basic-image-processing-workflow.md)
- [Applying geometric transforms to images](accelerate/applying-geometric-transforms-to-images.md)
- [Compositing images with alpha blending](accelerate/compositing-images-with-alpha-blending.md)
- [Compositing images with vImage blend modes](accelerate/compositing-images-with-vimage-blend-modes.md)
- [Applying vImage operations to regions of interest](accelerate/applying-vimage-operations-to-regions-of-interest.md)
- [Optimizing image-processing performance](accelerate/optimizing-image-processing-performance.md)
- [vImage](accelerate/vimage-library.md)
