The data formats that describe the organization and characteristics of individual pixels in a texture.

SDKs

iOS 8.0+

macOS 10.11+

tvOS 9.0+

Framework

Metal

Declaration

Overview

There are three varieties of pixel formats: ordinary, packed, and compressed. For ordinary and packed formats, the name of the pixel format specifies the order of components (such as R, RG, RGB, RGBA, BGRA), bits per component (such as 8, 16, 32), and data type for the component (such as Float, Sint, Snorm, Uint, Unorm). If the pixel format name has the _sRGB suffix, then sRGB gamma compression and decompression are applied during the reading and writing of color values in the pixel. For compressed formats, the name of the pixel format specifies a compression family (such as ASTC, BC, EAC, ETC2, PVRTC).

Storage Characteristics

The storage size of each pixel format is determined by the sum of its components. For example, the storage size of BGRA8Unorm is 32 bits (four 8-bit components) and the storage size of BGR5A1Unorm is 16 bits (three 5-bit components and one 1-bit component).

For normalized signed integer formats (Snorm), component values in the range [-1.0, 1.0] are stored as [MIN_INT, MAX_INT], where MIN_INT is the greatest negative integer and MAX_INT is the greatest positive integer that can be stored, given the bit size of the component. For normalized unsigned integer formats (Unorm), component values in the range [0.0, 1.0] are stored as [0, MAX_UINT], where MAX_UINT is the greatest unsigned integer that can be stored, given the bit size of the component.

Format data is stored in little-endian order (that is, the least-significant byte in the least-significant address). For formats with components that are themselves byte-aligned and more than one byte, the components are little-endian.

Compressed format using ASTC compression low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 4, the block height of 4, and a bit rate of 8.0 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 5, the block height of 4, and a bit rate of 6.4 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 5, the block height of 5, and a bit rate of 5.12 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 6, the block height of 5, and a bit rate of 4.27 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 6, the block height of 6, and a bit rate of 3.56 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 8, the block height of 5, and a bit rate of 3.2 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 8, the block height of 6, and a bit rate of 2.67 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 8, the block height of 8, and a bit rate of 2.0 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 10, the block height of 5, and a bit rate of 2.56 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 10, the block height of 6, and a bit rate of 2.13 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 10, the block height of 8, and a bit rate of 1.6 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 10, the block height of 10, and a bit rate of 1.28 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 12, the block height of 10, and a bit rate of 1.07 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content and conversion between sRGB and linear space. The image is encoded with the block width of 12, the block height of 12, and a bit rate of 0.89 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 4, the block height of 4, and a bit rate of 8.0 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 5, the block height of 4, and a bit rate of 6.4 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 5, the block height of 5, and a bit rate of 5.12 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 6, the block height of 5, and a bit rate of 4.27 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 6, the block height of 6, and a bit rate of 3.56 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 8, the block height of 5, and a bit rate of 3.2 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 8, the block height of 6, and a bit rate of 2.67 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 8, the block height of 8, and a bit rate of 2.0 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 10, the block height of 5, and a bit rate of 2.56 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 10, the block height of 6, and a bit rate of 2.13 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 10, the block height of 8, and a bit rate of 1.6 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 10, the block height of 10, and a bit rate of 1.28 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 12, the block height of 10, and a bit rate of 1.07 bits per pixel.

Compressed format using ASTC compression with low-dynamic range content that is encoded with the block width of 12, the block height of 12, and a bit rate of 0.89 bits per pixel.

Compressed format with two 64-bit chunks. The first chunk contains two 8-bit alpha components and one 48-bit descriptor component. The second chunk contains two 16-bit color components and one 32-bit descriptor component.

Compressed format with two 64-bit chunks, with conversion between sRGB and linear space. The first chunk contains two 8-bit alpha components and one 48-bit descriptor component. The second chunk contains two 16-bit color components and one 32-bit descriptor component.

Compressed format with two 64-bit chunks. The first chunk contains two 8-bit alpha components and one 48-bit descriptor component. The second chunk contains two 16-bit color components and one 32-bit descriptor component.

Compressed format with two 64-bit chunks, with conversion between sRGB and linear space. The first chunk contains two 8-bit alpha components and one 48-bit descriptor component. The second chunk contains two 16-bit color components and one 32-bit descriptor component.

A packed 32-bit combined depth and stencil pixel format with two normalized unsigned integer components: 24 bits, typically used for a depth render target, and 8 bits, typically used for a stencil render target.

A 64-bit combined depth and stencil pixel format with two floating-point components: 32 bits, typically used for a depth render target, and 8 bits, typically used for a stencil render target.

A stencil pixel format used for a stencil texture view, typically created from a parent texture with the MTLPixelFormatDepth32Float_Stencil8 pixel format.

A stencil pixel format used for a stencil texture view, typically created from a parent texture with the MTLPixelFormatDepth24Unorm_Stencil8 pixel format.