{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/reference/colorimetry/format",
  "collection": "docs",
  "title": "Color Formats",
  "description": "How pixel formats describe color model, chroma subsampling, bit depth, planar or packed layout and endianness, with FFmpeg and VapourSynth names.",
  "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/reference/colorimetry/format.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/reference/colorimetry/format.md",
  "status": "current",
  "tags": [
    "migrated"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "FFmpeg n9.0.2 pixel format definitions (libavutil/pixfmt.h)",
      "url": "https://github.com/FFmpeg/FFmpeg/blob/n9.0.2/libavutil/pixfmt.h",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "VapourSynth R81 preset video formats",
      "url": "https://github.com/vapoursynth/vapoursynth/blob/R81/doc/api/vapoursynth4.h.rst",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "YUV — VideoLAN Wiki",
      "url": "https://wiki.videolan.org/YUV/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/colorimetry/format.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/colorimetry/format.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "Color models",
      "anchor": "color-models"
    },
    {
      "depth": 2,
      "text": "Chroma subsampling",
      "anchor": "chroma-subsampling"
    },
    {
      "depth": 2,
      "text": "Bit depth",
      "anchor": "bit-depth"
    },
    {
      "depth": 2,
      "text": "Packed and planar",
      "anchor": "packed-and-planar"
    },
    {
      "depth": 2,
      "text": "Endianness",
      "anchor": "endianness"
    },
    {
      "depth": 2,
      "text": "Common formats",
      "anchor": "common-formats"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/_preamble.md",
      "checksum": "681f087ff309a1d49622c9ea929505e049ca03b642afe7e3b9ead9fdda9323c4",
      "bytes": 417
    },
    {
      "id": "color-models",
      "title": "Color models",
      "depth": 2,
      "anchor": "color-models",
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/#color-models",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/color-models.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/color-models.md",
      "checksum": "8c8bf4f03e0eb7aea63ed89cda7976d6cda655b6f4d9cb3627a29397c0ed7790",
      "bytes": 743
    },
    {
      "id": "chroma-subsampling",
      "title": "Chroma subsampling",
      "depth": 2,
      "anchor": "chroma-subsampling",
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/#chroma-subsampling",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/chroma-subsampling.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/chroma-subsampling.md",
      "checksum": "3918b0bb19f3ed227fbc94ebbbbe510d14432c40fd99da3d660ed2764e207ee2",
      "bytes": 1218
    },
    {
      "id": "bit-depth",
      "title": "Bit depth",
      "depth": 2,
      "anchor": "bit-depth",
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/#bit-depth",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/bit-depth.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/bit-depth.md",
      "checksum": "77a163d206f6e965dffe30def310692fcbe61a1cde64d395ceedbc9deabc4f5c",
      "bytes": 413
    },
    {
      "id": "packed-and-planar",
      "title": "Packed and planar",
      "depth": 2,
      "anchor": "packed-and-planar",
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/#packed-and-planar",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/packed-and-planar.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/packed-and-planar.md",
      "checksum": "5a369f63f441084fbbb9e492abcbb0049cf20e290171aa4a5a5fcf6882086ddf",
      "bytes": 499
    },
    {
      "id": "endianness",
      "title": "Endianness",
      "depth": 2,
      "anchor": "endianness",
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/#endianness",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/endianness.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/endianness.md",
      "checksum": "413232c1d956142c0a470f345ba00cbfa97a07a3ec3d3a8b63c561425ace3c23",
      "bytes": 515
    },
    {
      "id": "common-formats",
      "title": "Common formats",
      "depth": 2,
      "anchor": "common-formats",
      "canonicalUrl": "https://encode.wiki/reference/colorimetry/format/#common-formats",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/common-formats.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/reference/colorimetry/format/common-formats.md",
      "checksum": "bbbf8745c2c199858fd9161e71fdd73ec2c959aad5a85ce2c30072a834bf5cba",
      "bytes": 881
    }
  ],
  "outboundReferences": [
    "/reference/colorimetry/intro/",
    "/reference/colorimetry/matrix/",
    "/reference/colorimetry/range/"
  ],
  "checksum": "1b26ffd23543e4f8c4982784eb072206fcf33239889de54f83f7db9b52cae1ce",
  "contentFormat": "markdown",
  "markdown": "A pixel format says how decoded samples are laid out in memory: the color model and component order, chroma subsampling, bit depth, whether components are packed or planar, and, for samples wider than a byte, the endianness. It says nothing about what the colors mean — that is the job of [primaries, transfer, matrix and range](/reference/colorimetry/intro/). A `yuv420p10le` file can be SDR BT.709, HDR10 or HLG.\n\n## Color models\n\n**RGB** stores red, green and blue directly. It is what displays ultimately show and what most image formats and screen captures use, but it compresses poorly because the three channels are highly correlated.\n\n**Y′CbCr**, usually called YUV in software, stores luma (Y′, a weighted sum of the gamma-encoded R′G′B′) and two color-difference channels (Cb, Cr). Almost all video codecs work in Y′CbCr because most detail ends up in luma, and the chroma channels can be stored at reduced resolution. The weights come from the [matrix coefficients](/reference/colorimetry/matrix/). Y′ is not the same as physical luminance.\n\nComponent order is written out in the name: `rgb24` stores R, G, B; `bgr24` stores B, G, R.\n\n## Chroma subsampling\n\n| Notation | Chroma resolution | FFmpeg example |\n| --- | --- | --- |\n| 4:2:0 | Half width, half height | `yuv420p` |\n| 4:2:2 | Half width, full height | `yuv422p` |\n| 4:4:4 | Full resolution | `yuv444p` |\n\n4:2:0 is used by DVD, Blu-ray, UHD Blu-ray, broadcast, streaming and almost all camera footage, because the reduced chroma resolution is rarely visible in natural images. 4:2:2 is common in professional cameras and intermediate codecs such as ProRes. 4:4:4 is worth it for screen recordings, game footage with UI, and text overlays, where thin colored edges smear and alias at 4:2:0.\n\nConverting a 4:2:0 source to 4:4:4 doesn't recover chroma detail — it only makes the file bigger. Encode in the source's subsampling unless you mean to reduce it, and check that the target profile and players support 4:2:2 or 4:4:4 before using them (most hardware decoders and browsers expect 4:2:0).\n\nSubsampled chroma also has a **chroma location**: where each chroma sample sits relative to the luma samples. ffprobe reports it as `chroma_location` (`left` is the MPEG-2/H.264/HEVC default; `topleft` is also common). Keep it unchanged when re-encoding and let the scaler know it when resampling.\n\n## Bit depth\n\nBit depth is the number of bits per component sample: 8 for most SDR delivery, 10 for HDR and for many AV1 and HEVC encodes, 12 for some cinema and Dolby Vision masters.\n\nNames can count bits per component or per pixel. `RGB888` means 8 bits each for R, G and B; `RGB565` means 5, 6 and 5 bits. A per-pixel name such as `RGB24` (24 bits in total) or `RGB16` doesn't tell you how the bits are split.\n\n## Packed and planar\n\nPacked formats interleave the components of each pixel:\n\n```text\nRGB RGB RGB RGB …\n```\n\nPlanar formats store each component in its own plane:\n\n```text\nR R R R …\nG G G G …\nB B B B …\n```\n\nPlanar layouts make per-channel processing and chroma subsampling simple, so video codecs and VapourSynth use them almost exclusively. Packed layouts are common in hardware, capture devices and image APIs. FFmpeg marks planar formats with `p` (`yuv420p`, `gbrp`); `rgb24` is packed.\n\n## Endianness\n\nSamples wider than 8 bits are stored in 16-bit words, and the byte order matters. FFmpeg names end in `le` (little-endian, least significant byte first) or `be`. `yuv420p10le` stores each 10-bit sample in the low bits of a little-endian 16-bit word; it is not a tightly packed 10-bit stream. Reading data with the wrong depth, order or endianness produces garbage colors, which is the usual cause when a raw pipe between two programs looks wrong. VapourSynth formats are always in native byte order.\n\n## Common formats\n\n| VapourSynth | FFmpeg | Layout |\n| --- | --- | --- |\n| `GRAY8` | `gray` | One 8-bit plane |\n| `GRAY16` | `gray16le` | One 16-bit plane |\n| `RGB24` | `gbrp` | Planar RGB, 8 bits; FFmpeg stores the planes in G, B, R order |\n| — | `rgb24` | Packed RGB, 8 bits |\n| `RGBS` | `gbrpf32le` | Planar RGB, 32-bit float |\n| `YUV420P8` | `yuv420p` | Planar 4:2:0, 8 bits |\n| `YUV422P8` | `yuv422p` | Planar 4:2:2, 8 bits |\n| `YUV444P8` | `yuv444p` | Planar 4:4:4, 8 bits |\n| `YUV420P10` | `yuv420p10le` | Planar 4:2:0, 10 bits in 16-bit words |\n| `YUV422P10` | `yuv422p10le` | Planar 4:2:2, 10 bits |\n| `YUV444P10` | `yuv444p10le` | Planar 4:4:4, 10 bits |\n\n`ffmpeg -pix_fmts` lists every format your build knows. FFmpeg also has `yuvj420p` and other `yuvj` variants, which are old aliases for full-range 8-bit Y′CbCr; see [color range](/reference/colorimetry/range/).\n"
}
