Skip to content

10 bit colors to numpy #1714

Jan 16, 2025 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

The issue here is that you're converting the YUV data to RGB format with to_ndarray(format="rgb48"). This conversion process is what's causing you to see more unique values than expected.

Your original video is in YUV422p10le format, where each component indeed has 10-bit depth (0-1023 possible values)
When you convert to "rgb48" format:

  • A color space conversion from YUV to RGB occurs
  • Each YUV value gets transformed using the YUV->RGB conversion matrix
  • These calculations create new values through interpolation
  • The resulting RGB values use the full 16-bit range

To see the original 10-bit values, you should read the frame in its native YUV format, which I think is:

    np_frame = frame.to…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@johan-sightic
Comment options

Answer selected by WyattBlue
Comment options

You must be logged in to vote
1 reply
@johan-sightic
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1713 on January 16, 2025 14:01.