---
title: "init(data:size:flipped:)"
framework: spritekit
role: symbol
role_heading: Initializer
path: "spritekit/sktexture/init(data:size:flipped:)"
---

# init(data:size:flipped:)

Creates a new texture from raw pixel data.

## Declaration

```swift
convenience init(data pixelData: Data, size: CGSize, flipped: Bool)
```

## Parameters

- `pixelData`: An NSData object that holds the bitmap data. The pixels must be 32 bpp, 8bpc (unsigned integer) RGBA pixel data. The color components should have been already multiplied by the alpha value.
- `size`: The size of the new texture in points.
- `flipped`: A Boolean value that indicates whether the image data should be vertically flipped before creating the texture.

## Return Value

Return Value A new texture object.

## Discussion

Discussion The image data is copied before control is returned to your game.

## See Also

### Texture from Data

- [init(data:size:)](spritekit/sktexture/init(data:size:).md)
- [init(data:size:rowLength:alignment:)](spritekit/sktexture/init(data:size:rowlength:alignment:).md)
