#rgb #color-space #color #encoding #ycbcr #bt601 #rec709

yuv

Conversion between various YUV (YCbCr) formats and RGB

2 releases

0.1.5 Sep 5, 2022
0.1.4 May 30, 2021
0.1.2 May 30, 2021
0.1.1 May 30, 2021
0.1.0 Sep 6, 2020

#64 in Multimedia

Download history 98/week @ 2023-12-04 118/week @ 2023-12-11 206/week @ 2023-12-18 59/week @ 2023-12-25 72/week @ 2024-01-01 101/week @ 2024-01-08 124/week @ 2024-01-15 111/week @ 2024-01-22 88/week @ 2024-01-29 105/week @ 2024-02-05 81/week @ 2024-02-12 179/week @ 2024-02-19 265/week @ 2024-02-26 159/week @ 2024-03-04 101/week @ 2024-03-11 84/week @ 2024-03-18

624 downloads per month
Used in 11 crates (4 directly)

BSD-2-Clause

35KB
952 lines

YUV formats

This crate implements conversions from YUV/YCbCr formats to RGB. It also contains enums/constants for describing color spaces common in video formats.

Currently it's in an early stage, implementing subset needed for decoding AV1/AVIF.

Implemented

  • Matrix conversion for BT601, BT709, FCC, BT470BG, SMPTE240
  • YCgCo (untested)
  • Identity pass-through (GBR)
  • Studio and full range colors
  • 8-bit, and 10/12 to 16-bit conversions

Planned

  • Gamma conversion
  • Color primaries conversion
  • Chroma upsampling
  • RGB to YUV conversion
  • YUV pixel convenience functions, like in rgb
  • 8-to-16-bit expanding conversion
  • HDR to SDR conversion?
  • Maybe HDR support?

lib.rs:

This crate contains two things:

  1. color enums that can be used to describe color spaces in image and video formats, as defined in ISO/IEC 23091-4/ITU-T H.273
  2. Routines to convert between YUV family of color spaces and RGB.

Dependencies

~235KB