danchitnis / webgl-plot

A high-Performance real-time 2D plotting library based on native WebGL
https://danchitnis.github.io/webgl-plot-examples/vanilla/
MIT License
575 stars 33 forks source link

💡Feature Request: Integration of Color Scopes (Vectorscope, Waveform Monitor, etc.) into webgl-plot #84

Open johan149 opened 1 month ago

johan149 commented 1 month ago

Is your feature request related to a problem? Please describe.

I'm working on real-time video analysis and color grading tools that require efficient rendering of various color scopes. While webgl-plot excels at high-performance 2D plotting using WebGL, it currently lacks built-in support for visualizing color scopes essential for video processing tasks.

These scopes include:

Implementing these scopes from scratch is complex and may not achieve the performance needed for real-time applications, especially with high-resolution or live video streams. There is a need for a GPU-accelerated library that can render these scopes efficiently within a web application.


Describe the solution you'd like

I would like to request the integration of comprehensive color scopes into the webgl-plot library. Specifically, adding support for:

  1. Waveform Scopes:

    • Luma Waveform: Displays luminance levels across the image to help adjust exposure and ensure that blacks and whites are within legal broadcast limits.
    • RGB Waveform: Shows levels of red, green, and blue channels over the image, useful for balancing color channels and achieving color neutrality.
    • YC Waveform: Combines luminance with chrominance information, allowing users to see both brightness and color data.
    • RGB Parade: Displays the red, green, and blue channels side by side, enabling detailed color channel analysis and adjustments.
    • YUV Parade: Similar to RGB Parade but for YUV color space components.
  2. Vectorscope:

    • Plots chrominance information onto a circular graph, representing hue and saturation.
    • Essential for evaluating color balance, skin tones, and ensuring colors are within legal saturation limits for broadcast.
    • Skin Tone Indicator: An overlay within the Vectorscope to help ensure accurate skin tone representation, aligning with the skin tone line commonly used in color grading.
  3. Histogram:

    • Shows the distribution of pixel brightness or color values, assisting in assessing the overall tonal range and detecting clipping in shadows or highlights.
    • RGB Histogram: Separate histograms for red, green, and blue channels to analyze color balance and detect color casts.
  4. Additional Features:

    • Clipping Indicators: Visual markers to indicate areas of the image that are overexposed or underexposed, helping prevent loss of detail.
    • Customizable Graticules: Allow users to overlay reference markers or grids on scopes for precise measurements and adherence to broadcast standards.
    • Zoom and Crop Functionality: Enable zooming into specific areas of the scopes or cropping the image to focus on particular regions, enhancing analysis accuracy.
    • Persistence Effects: Options to simulate phosphor decay effects, where the scopes accumulate data over time, useful for visualizing changes in dynamic scenes.

By leveraging WebGL's GPU acceleration through webgl-plot, these scopes can be rendered efficiently, enabling real-time visualization and analysis of video data directly in the browser. This integration would greatly enhance the library's capabilities and make it an invaluable tool for developers working on video processing, broadcasting tools, and content creation applications.


Describe alternatives you've considered


References for Color Scopes:

Benefits of Integration:


Thank you for considering this feature request!

I'm excited about the potential enhancements this could bring to webgl-plot. Integrating these color scopes would make it a comprehensive tool for real-time video analysis and visualization. I'm more than willing to assist with testing, providing further insights, or contributing to the development if needed.

Please let me know if you have any questions or require additional information.

danchitnis commented 2 weeks ago

@johan149 Thanks for posting this. Color scope and video graphs are entirely different graphs in nature with webglplot. The goal of webglplot is the accelerated plotting and handling of lines using numerical data points that the user gives to the library. In contrast, lines are not required for a colour scope. You have a fixed pixelated canvas, and then you draw RGB pixels based on the processing of your source video. The processing may be accelerated via GPU, but that GPU code has no similarity to the GPU code for webglplot. hope that helps.