Skip to content

HDR-10bpp-Display-Test: Packing ten-bit channels for a Cairo surface

This display experiment loads image data into a GTK drawing area through Cairo. Viewer3.py makes the pixel representation explicit: channel samples are masked and packed into a uint32 buffer before creating an RGB30 surface.

Hardware and graphics
  • Updated
  • 13
  • Python · 98.43%
Repository languagesPython 98.43%2

Shares calculated from GitHub Linguist bytes.

Language%Bytes
Python98.43%8,200
Shell1.57%131

GitHub · README · Language statistics

Overview

Why it exists

10-bit HDR pipeline testing color banding and luminance curves on Linux display servers.

Best fit

Calibration and verification of 4K 10-bit HDR displays on Linux workstations.

Getting started

These commands come from the repository documentation. They were not run during this review.

README.md · Prerequisites
sudo apt-get install xserver-xorg python3 python3-gi python3-gi-cairo gir1.2-gtk-3.0 imagej
README.md · Installing
pip3 install imageio
README.md · Running the test
git clone https://github.com/yourusername/HDR-10bpp-Display-Test.git
README.md · Running the test
cd HDR-10bpp-Display-Test
README.md · Running the test
sudo systemctl stop lightdm || sudo systemctl stop gdm
sudo pkill Xorg

Repository references

Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.

Prerequisites and first run

Prerequisites

README.md

To run the test, you will need the following software installed on your system:

  • X server
  • Python 3
  • GTK 3
  • ImageJ (for displaying images with a 10-bit color depth)
  • ImageIO (for reading image files) You can install these packages on Ubuntu or Debian-based systems by running the following command:
Read the full instructions ↗

Installing

README.md

To install ImageIO, you can use pip:
Read the full instructions ↗
Operations and troubleshooting

Troubleshooting

README.md

If the X server does not start with a color depth of 30, try starting it with a color depth of 24:
Read the full instructions ↗
Development and contributions

HDR-10bpp-Display-Test

README.md

This is a simple test to verify the HDR 4K display on Linux using a color depth of 10 bits per channel. The test requires an HDR 4K display and a Linux environment with the X server installed.
Read the full instructions ↗

Running the test

README.md

To run the test, follow these steps:

  1. Clone the repository:
  2. Navigate to the project directory:
  3. Stop the display manager and X server:
  4. Start the X server with a color depth of 30:
  5. If the X server was started successfully, the output of the following command should indicate a depth of 30:
  6. Launch the viewer application:
  7. The viewer window will open. To display an image, run the following command:
  8. The image should be displayed in the viewer window. Verify that the image is displayed correctly and that the colors are accurate.
Read the full instructions ↗
Source documentation

1 documents read from 1 candidates.

Features and components 2

Pixels and drawing
imageio reads the source array. _draw_on allocates a packed buffer and shifts each channel according to the selected depth, then passes it to cairo.ImageSurface.create_for_data. The GTK draw callback paints that surface.
Video path
A worker reads video frames and updates the current image at a requested cadence. Drawing also manually processes pending GTK events. This older approach deserves particular attention to UI-thread ownership when maintained.

Architecture

The components and their connections remain available as text. The diagram adds an interactive view.

System context Context
  1. Image or video input
  2. imageio array
  3. Channel masking and packing
  4. Cairo RGB30 surface
  5. GTK drawing area

Links verified in the repository.

Mermaid Interactive diagram (loads on open)

System overview of the components and connections verified in the repository.

Static architecture view for HDR-10bpp-Display-Test
Static preview. The interactive diagram replaces it after Mermaid loads.
flowchart LR

subgraph group_setup["Display setup"]
  node_xserver["X server"]
end

subgraph group_viewers["Viewer applications"]
  node_viewer1["Image viewer<br/>[Viewer.py]"]
  node_viewer3["Image/video viewer<br/>[Viewer3.py]"]
end

subgraph group_render["Image rendering"]
  node_gtk1["GTK window<br/>[Viewer.py]"]
  node_gtk3["GTK window<br/>[Viewer3.py]"]
  node_imageio1["Image input<br/>[Viewer.py]"]
  node_imageio3["Image/video input<br/>[Viewer3.py]"]
  node_cairo1["Cairo drawing<br/>[Viewer.py]"]
  node_cairo3["Cairo drawing<br/>[Viewer3.py]"]
end

node_user(("Test operator"))
node_imagej["ImageJ"]

node_user -->|"starts at depth"| node_xserver
node_user -->|"launches"| node_viewer1
node_user -->|"launches"| node_viewer3
node_viewer1 -->|"creates window"| node_gtk1
node_viewer1 -->|"reads image"| node_imageio1
node_viewer1 -->|"draws image"| node_cairo1
node_gtk1 -->|"dispatches draw"| node_cairo1
node_viewer3 -->|"creates window"| node_gtk3
node_viewer3 -->|"reads image/video"| node_imageio3
node_viewer3 -->|"draws frames"| node_cairo3
node_gtk3 -->|"dispatches draw"| node_cairo3
node_user -->|"opens image"| node_imagej
node_imagej -->|"displays for checking"| node_viewer1


class node_xserver toneBlue
class node_viewer1,node_viewer3 toneAmber
class node_gtk1,node_gtk3,node_imageio1,node_imageio3,node_cairo1,node_cairo3 toneMint
class node_user,node_imagej toneIndigo

A Linux HDR and 10-bit display test. The workflow starts an X server at the requested depth, opens an image or video viewer, and draws frames through GTK and Cairo for visual checking.

Components
11
Connections
13
Links supported by code or README
13/13
Text version of the diagram
  • Image or video input → imageio array
  • imageio array → Channel masking and packing
  • Channel masking and packing → Cairo RGB30 surface
  • Cairo RGB30 surface → GTK drawing area
Follow one path through the code

Inspect _draw_on to see exactly where bit depth affects shifts and surface selection. Ten-bit storage concerns numeric precision; HDR transfer functions, metadata and display calibration require additional work outside this packing step.

Types and file structure

2 declared types, with 2 in the base-relationship overview.

Type diagram
classDiagram
direction TB
class td926548d9d56["Viewer"] {
  __init__()
  _initUI()
  _window_state()
  size()
}
class t015018d2192b["Viewer"] {
  __init__()
  _initUI()
  _window_state()
  size()
}
class bb574778f1f7f["object"] {
  <<unresolved_base>>
}
bb574778f1f7f <|-- td926548d9d56
class ba71980200e35["object"] {
  <<unresolved_base>>
}
ba71980200e35 <|-- t015018d2192b

Unresolved bases remain labelled; full signatures are not reconstructed.

Type index
  • Viewer (class) · Viewer3.py:27

    Methods in the overview: __init__, _initUI, _window_state, size.

    Declared bases: object.

  • Viewer (class) · Viewer.py:24

    Methods in the overview: __init__, _initUI, _window_state, size.

    Declared bases: object.

Reference

4 / 4 eligible files read (7 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.

What the scan covers

Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.

Linguist statistics cover the whole repository and may include other languages.

File map
flowchart TD
  root["HDR-10bpp-Display-Test"]
  f0["Viewer3.py"]
  root --> f0
  f1["Xdepth.sh"]
  root --> f1
  f2["README.md"]
  root --> f2
  f3["Viewer.py"]
  root --> f3

Files to read 3

References