<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKTexture",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTexture"
  },
  "title" : "SKTexture"
}
-->

# SKTexture

An image, decoded on the GPU, that can be used to render various SpriteKit objects.

```
class SKTexture
```

## Overview

An [`SKTexture`](/documentation/SpriteKit/SKTexture) object is an image that can be applied to [`SKSpriteNode`](/documentation/SpriteKit/SKSpriteNode) and [`SKShapeNode`](/documentation/SpriteKit/SKShapeNode) objects, particles created by an [`SKEmitterNode`](/documentation/SpriteKit/SKEmitterNode) object, or tiles used in an [`SKTileMapNode`](/documentation/SpriteKit/SKTileMapNode). A texture object manages the texture data and graphics resources that are needed to render the image. Most texture objects are created from source images stored in your app bundle—your game’s artwork. Once created, a texture object’s contents are immutable. Multiple sprites can share the same texture object, sharing a single resource.

### Deallocating a Texture

After a texture is loaded into the graphics hardware memory, it stays in memory until the referencing [`SKTexture`](/documentation/SpriteKit/SKTexture) object is deleted. This means that between levels (or in a dynamic game), you may need to make sure a texture object is deleted. Delete a [`SKTexture`](/documentation/SpriteKit/SKTexture) object by removing any strong references to it, including:

- All texture references from [`SKSpriteNode`](/documentation/SpriteKit/SKSpriteNode) and [`SKEffectNode`](/documentation/SpriteKit/SKEffectNode) objects in your game
- Any strong references to the texture in your own code
- An [`SKTextureAtlas`](/documentation/SpriteKit/SKTextureAtlas) object that was used to create the texture object

## Topics

### First Steps

Create texture objects from images on disk or in memory.

[Loading and Using Textures](/documentation/SpriteKit/loading-and-using-textures)

Learn the basics about using textures in SpriteKit.

[Texture Initializers](/documentation/SpriteKit/texture-initializers)

See the various ways to create and use textures in SpriteKit.

### Reading a Texture’s Size and Optional Source Location

Read the texture’s size or optional cropping rectangle.

[`size()`](/documentation/SpriteKit/SKTexture/size())

Gets the size of the texture.

[`textureRect()`](/documentation/SpriteKit/SKTexture/textureRect())

Gets a rectangle that defines the portion of the texture used to render its image.

### Configuring a Texture’s Behavior for Scaling

Define the texture’s behavior at different scales.

[`filteringMode`](/documentation/SpriteKit/SKTexture/filteringMode)

The filtering mode used when the size of a sprite drawn with the texture is not drawn at the texture’s native size.

[`SKTextureFilteringMode`](/documentation/SpriteKit/SKTextureFilteringMode)

Texture filtering modes to use when the texture is drawn in a size other than its native size.

[`usesMipmaps`](/documentation/SpriteKit/SKTexture/usesMipmaps)

A Boolean value that indicates whether the texture attempts to generate mipmaps.

### Getting a Texture’s Underlying Image

[`cgImage()`](/documentation/SpriteKit/SKTexture/cgImage())

Returns the texture’s image data as a Quartz 2D image.

### Preloading a Texture for Performance

Gain fine-tuned control over when a texture is decoded.

[Preloading Textures into Memory](/documentation/SpriteKit/preloading-textures-into-memory)

Decompress images ahead of time to avoid performance issues during gameplay.

[`preload(completionHandler:)`](/documentation/SpriteKit/SKTexture/preload(completionHandler:))

Load texture data into memory, calling a completion handler after the task completes.

[`preload(_:withCompletionHandler:)`](/documentation/SpriteKit/SKTexture/preload(_:withCompletionHandler:))

Load the data of multiple textures into memory.

### Instance Properties

[`customPlaygroundQuickLook`](/documentation/SpriteKit/SKTexture/customPlaygroundQuickLook)



---

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)