---
title: "init(size:pixelFormat:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/skmutabletexture/init(size:pixelformat:)"
---

# init(size:pixelFormat:)

Initializes an empty texture with a specific size and format.

## Declaration

```swift
init(size: CGSize, pixelFormat format: Int32)
```

## Parameters

- `size`: The size of the texture, in pixels.
- `format`: A Core Video format code. Three codes are supported: doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_32RGBA, doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_64RGBAHalf, and doc://com.apple.documentation/documentation/CoreVideo/kCVPixelFormatType_128RGBAFloat for byte, half-float, and float components respectively.

## Return Value

Return Value An empty mutable texture.

## Discussion

Discussion You must call the modifyPixelData(_:) method at least once before using this texture.

## See Also

### Creating an Empty Mutable Texture

- [init(size:)](spritekit/skmutabletexture/init(size:).md)
