---
title: MTLPixelFormat
framework: metal
role: symbol
role_heading: Enumeration
path: metal/mtlpixelformat
---

# MTLPixelFormat

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

## Declaration

```swift
enum MTLPixelFormat
```

## Overview

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 reading and writing pixel data applies sRGB gamma compression and decompression. The alpha component of sRGB pixel formats is always treated as a linear value. For compressed formats, the name of the pixel format specifies a compression family (such as ASTC, BC, EAC, ETC2, PVRTC). note: Pixel format availability and capabilities vary by feature set. See Pixel Format Capabilities for more information. Storage characteristics The number and size of each pixel component determines the storage size of each pixel format. For example, the storage size of MTLPixelFormat.bgra8Unorm is 32 bits (four 8-bit components) and the storage size of MTLPixelFormat.bgr5A1Unorm is 16 bits (three 5-bit components and one 1-bit component). For normalized signed integer formats (Snorm), values in the range [-1.0, 1.0] map to [MIN_INT, MAX_INT], where MIN_INT is the most negative integer and MAX_INT is the most positive integer for the number of bits in the storage size. Positive values and zero distribute uniformly in the range [0.0, 1.0], and negative integer values greater than (MIN_INT + 1) distribute uniformly in the range (-1.0, 0.0). important: For Snorm formats, the values MIN_INT and (MIN_INT + 1) both map to -1.0. For normalized unsigned integer formats (Unorm), values in the range [0.0, 1.0] are uniformly mapped to [0, MAX_UINT], where MAX_UINT is the largest unsigned integer for the number of bits in the storage size. Metal stores format data in little-endian byte order, with the least-significant byte at the lowest memory address. For formats with components that are themselves byte-aligned and more than one byte, Metal also stores each component in little-endian byte order. See Table 7.7 in the Metal Shading Language Specification (PDF) for details on pixel format normalization.

## Topics

### Ordinary 8-bit pixel formats

- [MTLPixelFormat.a8Unorm](metal/mtlpixelformat/a8unorm.md)
- [MTLPixelFormat.r8Unorm](metal/mtlpixelformat/r8unorm.md)
- [MTLPixelFormat.r8Unorm_srgb](metal/mtlpixelformat/r8unorm_srgb.md)
- [MTLPixelFormat.r8Snorm](metal/mtlpixelformat/r8snorm.md)
- [MTLPixelFormat.r8Uint](metal/mtlpixelformat/r8uint.md)
- [MTLPixelFormat.r8Sint](metal/mtlpixelformat/r8sint.md)

### Ordinary 16-bit pixel formats

- [MTLPixelFormat.r16Unorm](metal/mtlpixelformat/r16unorm.md)
- [MTLPixelFormat.r16Snorm](metal/mtlpixelformat/r16snorm.md)
- [MTLPixelFormat.r16Uint](metal/mtlpixelformat/r16uint.md)
- [MTLPixelFormat.r16Sint](metal/mtlpixelformat/r16sint.md)
- [MTLPixelFormat.r16Float](metal/mtlpixelformat/r16float.md)
- [MTLPixelFormat.rg8Unorm](metal/mtlpixelformat/rg8unorm.md)
- [MTLPixelFormat.rg8Unorm_srgb](metal/mtlpixelformat/rg8unorm_srgb.md)
- [MTLPixelFormat.rg8Snorm](metal/mtlpixelformat/rg8snorm.md)
- [MTLPixelFormat.rg8Uint](metal/mtlpixelformat/rg8uint.md)
- [MTLPixelFormat.rg8Sint](metal/mtlpixelformat/rg8sint.md)

### Packed 16-bit pixel formats

- [MTLPixelFormat.b5g6r5Unorm](metal/mtlpixelformat/b5g6r5unorm.md)
- [MTLPixelFormat.a1bgr5Unorm](metal/mtlpixelformat/a1bgr5unorm.md)
- [MTLPixelFormat.abgr4Unorm](metal/mtlpixelformat/abgr4unorm.md)
- [MTLPixelFormat.bgr5A1Unorm](metal/mtlpixelformat/bgr5a1unorm.md)

### Ordinary 32-bit pixel formats

- [MTLPixelFormat.r32Uint](metal/mtlpixelformat/r32uint.md)
- [MTLPixelFormat.r32Sint](metal/mtlpixelformat/r32sint.md)
- [MTLPixelFormat.r32Float](metal/mtlpixelformat/r32float.md)
- [MTLPixelFormat.rg16Unorm](metal/mtlpixelformat/rg16unorm.md)
- [MTLPixelFormat.rg16Snorm](metal/mtlpixelformat/rg16snorm.md)
- [MTLPixelFormat.rg16Uint](metal/mtlpixelformat/rg16uint.md)
- [MTLPixelFormat.rg16Sint](metal/mtlpixelformat/rg16sint.md)
- [MTLPixelFormat.rg16Float](metal/mtlpixelformat/rg16float.md)
- [MTLPixelFormat.rgba8Unorm](metal/mtlpixelformat/rgba8unorm.md)
- [MTLPixelFormat.rgba8Unorm_srgb](metal/mtlpixelformat/rgba8unorm_srgb.md)
- [MTLPixelFormat.rgba8Snorm](metal/mtlpixelformat/rgba8snorm.md)
- [MTLPixelFormat.rgba8Uint](metal/mtlpixelformat/rgba8uint.md)
- [MTLPixelFormat.rgba8Sint](metal/mtlpixelformat/rgba8sint.md)
- [MTLPixelFormat.bgra8Unorm](metal/mtlpixelformat/bgra8unorm.md)
- [MTLPixelFormat.bgra8Unorm_srgb](metal/mtlpixelformat/bgra8unorm_srgb.md)

### Packed 32-bit pixel formats

- [MTLPixelFormat.bgr10a2Unorm](metal/mtlpixelformat/bgr10a2unorm.md)
- [MTLPixelFormat.rgb10a2Unorm](metal/mtlpixelformat/rgb10a2unorm.md)
- [MTLPixelFormat.rgb10a2Uint](metal/mtlpixelformat/rgb10a2uint.md)
- [MTLPixelFormat.rg11b10Float](metal/mtlpixelformat/rg11b10float.md)
- [MTLPixelFormat.rgb9e5Float](metal/mtlpixelformat/rgb9e5float.md)

### Ordinary 64-bit pixel formats

- [MTLPixelFormat.rg32Uint](metal/mtlpixelformat/rg32uint.md)
- [MTLPixelFormat.rg32Sint](metal/mtlpixelformat/rg32sint.md)
- [MTLPixelFormat.rg32Float](metal/mtlpixelformat/rg32float.md)
- [MTLPixelFormat.rgba16Unorm](metal/mtlpixelformat/rgba16unorm.md)
- [MTLPixelFormat.rgba16Snorm](metal/mtlpixelformat/rgba16snorm.md)
- [MTLPixelFormat.rgba16Uint](metal/mtlpixelformat/rgba16uint.md)
- [MTLPixelFormat.rgba16Sint](metal/mtlpixelformat/rgba16sint.md)
- [MTLPixelFormat.rgba16Float](metal/mtlpixelformat/rgba16float.md)

### Ordinary 128-bit pixel formats

- [MTLPixelFormat.rgba32Uint](metal/mtlpixelformat/rgba32uint.md)
- [MTLPixelFormat.rgba32Sint](metal/mtlpixelformat/rgba32sint.md)
- [MTLPixelFormat.rgba32Float](metal/mtlpixelformat/rgba32float.md)

### Compressed PVRTC pixel formats

- [MTLPixelFormat.pvrtc_rgb_2bpp](metal/mtlpixelformat/pvrtc_rgb_2bpp.md)
- [MTLPixelFormat.pvrtc_rgb_2bpp_srgb](metal/mtlpixelformat/pvrtc_rgb_2bpp_srgb.md)
- [MTLPixelFormat.pvrtc_rgb_4bpp](metal/mtlpixelformat/pvrtc_rgb_4bpp.md)
- [MTLPixelFormat.pvrtc_rgb_4bpp_srgb](metal/mtlpixelformat/pvrtc_rgb_4bpp_srgb.md)
- [MTLPixelFormat.pvrtc_rgba_2bpp](metal/mtlpixelformat/pvrtc_rgba_2bpp.md)
- [MTLPixelFormat.pvrtc_rgba_2bpp_srgb](metal/mtlpixelformat/pvrtc_rgba_2bpp_srgb.md)
- [MTLPixelFormat.pvrtc_rgba_4bpp](metal/mtlpixelformat/pvrtc_rgba_4bpp.md)
- [MTLPixelFormat.pvrtc_rgba_4bpp_srgb](metal/mtlpixelformat/pvrtc_rgba_4bpp_srgb.md)

### Compressed EAC/ETC pixel formats

- [MTLPixelFormat.eac_r11Unorm](metal/mtlpixelformat/eac_r11unorm.md)
- [MTLPixelFormat.eac_r11Snorm](metal/mtlpixelformat/eac_r11snorm.md)
- [MTLPixelFormat.eac_rg11Unorm](metal/mtlpixelformat/eac_rg11unorm.md)
- [MTLPixelFormat.eac_rg11Snorm](metal/mtlpixelformat/eac_rg11snorm.md)
- [MTLPixelFormat.eac_rgba8](metal/mtlpixelformat/eac_rgba8.md)
- [MTLPixelFormat.eac_rgba8_srgb](metal/mtlpixelformat/eac_rgba8_srgb.md)
- [MTLPixelFormat.etc2_rgb8](metal/mtlpixelformat/etc2_rgb8.md)
- [MTLPixelFormat.etc2_rgb8_srgb](metal/mtlpixelformat/etc2_rgb8_srgb.md)
- [MTLPixelFormat.etc2_rgb8a1](metal/mtlpixelformat/etc2_rgb8a1.md)
- [MTLPixelFormat.etc2_rgb8a1_srgb](metal/mtlpixelformat/etc2_rgb8a1_srgb.md)

### Compressed ASTC pixel formats

- [MTLPixelFormat.astc_4x4_srgb](metal/mtlpixelformat/astc_4x4_srgb.md)
- [MTLPixelFormat.astc_5x4_srgb](metal/mtlpixelformat/astc_5x4_srgb.md)
- [MTLPixelFormat.astc_5x5_srgb](metal/mtlpixelformat/astc_5x5_srgb.md)
- [MTLPixelFormat.astc_6x5_srgb](metal/mtlpixelformat/astc_6x5_srgb.md)
- [MTLPixelFormat.astc_6x6_srgb](metal/mtlpixelformat/astc_6x6_srgb.md)
- [MTLPixelFormat.astc_8x5_srgb](metal/mtlpixelformat/astc_8x5_srgb.md)
- [MTLPixelFormat.astc_8x6_srgb](metal/mtlpixelformat/astc_8x6_srgb.md)
- [MTLPixelFormat.astc_8x8_srgb](metal/mtlpixelformat/astc_8x8_srgb.md)
- [MTLPixelFormat.astc_10x5_srgb](metal/mtlpixelformat/astc_10x5_srgb.md)
- [MTLPixelFormat.astc_10x6_srgb](metal/mtlpixelformat/astc_10x6_srgb.md)
- [MTLPixelFormat.astc_10x8_srgb](metal/mtlpixelformat/astc_10x8_srgb.md)
- [MTLPixelFormat.astc_10x10_srgb](metal/mtlpixelformat/astc_10x10_srgb.md)
- [MTLPixelFormat.astc_12x10_srgb](metal/mtlpixelformat/astc_12x10_srgb.md)
- [MTLPixelFormat.astc_12x12_srgb](metal/mtlpixelformat/astc_12x12_srgb.md)
- [MTLPixelFormat.astc_4x4_ldr](metal/mtlpixelformat/astc_4x4_ldr.md)
- [MTLPixelFormat.astc_5x4_ldr](metal/mtlpixelformat/astc_5x4_ldr.md)
- [MTLPixelFormat.astc_5x5_ldr](metal/mtlpixelformat/astc_5x5_ldr.md)
- [MTLPixelFormat.astc_6x5_ldr](metal/mtlpixelformat/astc_6x5_ldr.md)
- [MTLPixelFormat.astc_6x6_ldr](metal/mtlpixelformat/astc_6x6_ldr.md)
- [MTLPixelFormat.astc_8x5_ldr](metal/mtlpixelformat/astc_8x5_ldr.md)
- [MTLPixelFormat.astc_8x6_ldr](metal/mtlpixelformat/astc_8x6_ldr.md)
- [MTLPixelFormat.astc_8x8_ldr](metal/mtlpixelformat/astc_8x8_ldr.md)
- [MTLPixelFormat.astc_10x5_ldr](metal/mtlpixelformat/astc_10x5_ldr.md)
- [MTLPixelFormat.astc_10x6_ldr](metal/mtlpixelformat/astc_10x6_ldr.md)
- [MTLPixelFormat.astc_10x8_ldr](metal/mtlpixelformat/astc_10x8_ldr.md)
- [MTLPixelFormat.astc_10x10_ldr](metal/mtlpixelformat/astc_10x10_ldr.md)
- [MTLPixelFormat.astc_12x10_ldr](metal/mtlpixelformat/astc_12x10_ldr.md)
- [MTLPixelFormat.astc_12x12_ldr](metal/mtlpixelformat/astc_12x12_ldr.md)
- [MTLPixelFormat.astc_4x4_hdr](metal/mtlpixelformat/astc_4x4_hdr.md)
- [MTLPixelFormat.astc_5x4_hdr](metal/mtlpixelformat/astc_5x4_hdr.md)
- [MTLPixelFormat.astc_5x5_hdr](metal/mtlpixelformat/astc_5x5_hdr.md)
- [MTLPixelFormat.astc_6x5_hdr](metal/mtlpixelformat/astc_6x5_hdr.md)
- [MTLPixelFormat.astc_6x6_hdr](metal/mtlpixelformat/astc_6x6_hdr.md)
- [MTLPixelFormat.astc_8x5_hdr](metal/mtlpixelformat/astc_8x5_hdr.md)
- [MTLPixelFormat.astc_8x6_hdr](metal/mtlpixelformat/astc_8x6_hdr.md)
- [MTLPixelFormat.astc_8x8_hdr](metal/mtlpixelformat/astc_8x8_hdr.md)
- [MTLPixelFormat.astc_10x5_hdr](metal/mtlpixelformat/astc_10x5_hdr.md)
- [MTLPixelFormat.astc_10x6_hdr](metal/mtlpixelformat/astc_10x6_hdr.md)
- [MTLPixelFormat.astc_10x8_hdr](metal/mtlpixelformat/astc_10x8_hdr.md)
- [MTLPixelFormat.astc_10x10_hdr](metal/mtlpixelformat/astc_10x10_hdr.md)
- [MTLPixelFormat.astc_12x10_hdr](metal/mtlpixelformat/astc_12x10_hdr.md)
- [MTLPixelFormat.astc_12x12_hdr](metal/mtlpixelformat/astc_12x12_hdr.md)

### Compressed BC pixel formats

- [MTLPixelFormat.bc1_rgba](metal/mtlpixelformat/bc1_rgba.md)
- [MTLPixelFormat.bc1_rgba_srgb](metal/mtlpixelformat/bc1_rgba_srgb.md)
- [MTLPixelFormat.bc2_rgba](metal/mtlpixelformat/bc2_rgba.md)
- [MTLPixelFormat.bc2_rgba_srgb](metal/mtlpixelformat/bc2_rgba_srgb.md)
- [MTLPixelFormat.bc3_rgba](metal/mtlpixelformat/bc3_rgba.md)
- [MTLPixelFormat.bc3_rgba_srgb](metal/mtlpixelformat/bc3_rgba_srgb.md)
- [MTLPixelFormat.bc4_rUnorm](metal/mtlpixelformat/bc4_runorm.md)
- [MTLPixelFormat.bc4_rSnorm](metal/mtlpixelformat/bc4_rsnorm.md)
- [MTLPixelFormat.bc5_rgUnorm](metal/mtlpixelformat/bc5_rgunorm.md)
- [MTLPixelFormat.bc5_rgSnorm](metal/mtlpixelformat/bc5_rgsnorm.md)
- [MTLPixelFormat.bc6H_rgbFloat](metal/mtlpixelformat/bc6h_rgbfloat.md)
- [MTLPixelFormat.bc6H_rgbuFloat](metal/mtlpixelformat/bc6h_rgbufloat.md)
- [MTLPixelFormat.bc7_rgbaUnorm](metal/mtlpixelformat/bc7_rgbaunorm.md)
- [MTLPixelFormat.bc7_rgbaUnorm_srgb](metal/mtlpixelformat/bc7_rgbaunorm_srgb.md)

### YUV pixel formats

- [MTLPixelFormat.gbgr422](metal/mtlpixelformat/gbgr422.md)
- [MTLPixelFormat.bgrg422](metal/mtlpixelformat/bgrg422.md)

### Depth and stencil pixel formats

- [MTLPixelFormat.depth16Unorm](metal/mtlpixelformat/depth16unorm.md)
- [MTLPixelFormat.depth32Float](metal/mtlpixelformat/depth32float.md)
- [MTLPixelFormat.stencil8](metal/mtlpixelformat/stencil8.md)
- [MTLPixelFormat.depth24Unorm_stencil8](metal/mtlpixelformat/depth24unorm_stencil8.md)
- [MTLPixelFormat.depth32Float_stencil8](metal/mtlpixelformat/depth32float_stencil8.md)
- [MTLPixelFormat.x32_stencil8](metal/mtlpixelformat/x32_stencil8.md)
- [MTLPixelFormat.x24_stencil8](metal/mtlpixelformat/x24_stencil8.md)

### Extended range and wide color pixel formats

- [MTLPixelFormat.bgra10_xr](metal/mtlpixelformat/bgra10_xr.md)
- [MTLPixelFormat.bgra10_xr_srgb](metal/mtlpixelformat/bgra10_xr_srgb.md)
- [MTLPixelFormat.bgr10_xr](metal/mtlpixelformat/bgr10_xr.md)
- [MTLPixelFormat.bgr10_xr_srgb](metal/mtlpixelformat/bgr10_xr_srgb.md)

### Sentinel values

- [MTLPixelFormat.invalid](metal/mtlpixelformat/invalid.md)

### Enumeration Cases

- [MTLPixelFormat.unspecialized](metal/mtlpixelformat/unspecialized.md)

### Initializers

- [init(rawValue:)](metal/mtlpixelformat/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Texture basics

- [Understanding color-renderable pixel format sizes](metal/understanding-color-renderable-pixel-format-sizes.md)
- [Optimizing texture data](metal/optimizing-texture-data.md)
- [MTLTexture](metal/mtltexture.md)
- [MTLTextureCompressionType](metal/mtltexturecompressiontype.md)
- [MTLTextureDescriptor](metal/mtltexturedescriptor.md)
- [MTKTextureLoader](metalkit/mtktextureloader.md)
- [MTLSharedTextureHandle](metal/mtlsharedtexturehandle.md)
