---
title: "init(offScreenWith:colorSpace:composition:)"
framework: quartz
role: symbol
role_heading: Initializer
path: "quartz/qcrenderer/init(offscreenwith:colorspace:composition:)"
---

# init(offScreenWith:colorSpace:composition:)

Creates an offscreen renderer of a given size with the provided color space and composition object.

## Declaration

```swift
init!(offScreenWith size: NSSize, colorSpace: CGColorSpace!, composition: QCComposition!)
```

## Parameters

- `size`: The size of the offscreen renderer.
- `colorSpace`: A Quartz color space object. This must be an RGB color space. Pass NULL to use the default RGB color space. For more information on Quartz color spaces, see https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066.
- `composition`: A doc://com.apple.quartz/documentation/Quartz/QCComposition object.

## Return Value

Return Value The initialized QCRenderer object or nil if initialization is not successful.

## Discussion

Discussion This method creates an internal OpenGL context and pixel buffer. Because offscreen rendering is performed on the GPU, the maximum rendering size is limited to the GPU capacity. On typical hardware, the limit is at least 2048 by 2048, but is often 4096 by 4096. The available VRAM affects performance.

## See Also

### Creating and Initializing a Renderer

- [init(composition:colorSpace:)](quartz/qcrenderer/init(composition:colorspace:).md)
- [init(openGLContext:pixelFormat:file:)](quartz/qcrenderer/init(openglcontext:pixelformat:file:).md)
- [init(cglContext:pixelFormat:colorSpace:composition:)](quartz/qcrenderer/init(cglcontext:pixelformat:colorspace:composition:)-7at42.md)
