Producing Image Waveforms

I just noticed image waveforms in Darktable and am excited to get under the hood. Anyone know of code / library for producing these that could work in a web app? I can do it on the command line if needed. I tried googling but so many false positives come up it’s impossible!

Thank you in advance for your attention and support! - J

dt code is open for viewing and forking, although I am sure the devs could show you where the code points are.

this is the darktable code

and this is the vkdt code

you can also use vkdt-cli with a graph that only has a hist module wired to an o-jpg if you want to compute it from command line.

1 Like

You’re very kind to take the time to share this info with me. Much gratitude! : )

It is a very basic plotting exercise.

  1. you divide the image into vertical bands (by pixel if necessary, but that may not be needed),
  2. generate a histogram (ie binned count) of RGB values in each band,
  3. map it into a matrix of RGB pixels (count to intensity, by channel)