#color #rgb #ycbcr #rec709 #bt601

yuv

Conversion between various YUV (YCbCr) formats and RGB

4 releases

0.1.4 May 30, 2021
0.1.2 May 30, 2021
0.1.1 May 30, 2021
0.1.0 Sep 6, 2020

#14 in Encoding

Download history 122/week @ 2021-05-29 58/week @ 2021-06-05 29/week @ 2021-06-12 46/week @ 2021-06-19 46/week @ 2021-06-26 79/week @ 2021-07-03 16/week @ 2021-07-10 54/week @ 2021-07-17 42/week @ 2021-07-24 88/week @ 2021-07-31 108/week @ 2021-08-07 161/week @ 2021-08-14 99/week @ 2021-08-21 94/week @ 2021-08-28 55/week @ 2021-09-04 33/week @ 2021-09-11

116 downloads per month
Used in 4 crates (2 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

~210KB