<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKMutableTexture/init(size:pixelFormat:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKMutableTexture(im)initWithSize:pixelFormat:"
  },
  "title" : "init(size:pixelFormat:)"
}
-->

# init(size:pixelFormat:)

Initializes an empty texture with a specific size and format.

```
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

An empty mutable texture.

## Discussion

You must call the [`modifyPixelData(_:)`](/documentation/SpriteKit/SKMutableTexture/modifyPixelData(_:)) method at least once before using this texture.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)