<p>Using <a href="https://ffmpeg.org/download.html" rel="nofollow noreferrer">ffmpeg</a>, a free command-line tool, you can do</p>

<pre><code>ffmpeg -i in.mp4 -vf "crop=1:1:234:541:exact=1,tile=50x10,format=rgb24,histogram" out.png
</code></pre>

<p>A series of filters are run on the input video.</p>

<p>The <a href="https://ffmpeg.org/ffmpeg-filters.html#crop" rel="nofollow noreferrer">crop</a> filter takes each frame and extracts a 1x1 sized window i.e. a single pixel at co-ordinates (234,541) measured from top-left of frame. Numbering starts at 0.</p>

<p>The <a href="https://ffmpeg.org/ffmpeg-filters.html#tile" rel="nofollow noreferrer">tile</a> filter collects all of these single pixel frames into a single frame of dimensions 50x10. It is important that the product of these dimensions (500) match the total number of frames in the video. If it's greater, the difference will be black pixels added by the tile filter and throw off your histogram; if less, frames will be skipped. Worst case scenario, your frame count is prime, so you can either do <code>Countx1</code> or <code>MxN</code> where M*N is <code>count + 1</code>.</p>

<p>The next filter converts the tile output to a RGB pixel format, since videos typically are YUV.</p>

<p>The <a href="https://ffmpeg.org/ffmpeg-filters.html#histogram" rel="nofollow noreferrer">histogram</a> filter generates a graphical RGB histogram which is saved to a PNG. See the filter doc for options to change layout or image size.</p>

CC BY-SA 4.0
2018-05-25T06:17:00.767Z
2018-05-25T06:17:00.767Z
Gyan
<p>The first thing I'd be looking at is <a href="https://processing.org/" rel="nofollow noreferrer">Processing</a>. There's a library that lets you read video, there's an example <a href="https://processing.org/reference/libraries/video/Movie_read_.html" rel="nofollow noreferrer">here</a> that shows how to to sequentially grab frames from a video.</p>

<p>Then (instead of displaying the frame like it does in that example) you need to find the channel values for the spot which you could do by copying the frame to a <a href="https://processing.org/reference/PImage.html" rel="nofollow noreferrer">PImage</a>. Then the value of the pixel (x,y) is found in the PImage property <code>pixels[x,y]</code>. Finally use <a href="https://processing.org/reference/createWriter_.html" rel="nofollow noreferrer">createWriter()</a> to output the data to a file. You could even get fancy and use the mouse to control your sample point, and so on.</p>

CC BY-SA 4.0
2018-05-25T03:47:25.163Z
2018-05-25T03:47:25.163Z
stib
<p>I have a video that I shot for scientific purposes. I would like to measure the colour information in a single spot and export for example the RGB or CMYK values of that spot through every frame into a text file.</p>

<p>The video itself is a .MOV file which I colour-balanced with a white card. I just couldn't find any information on how to extract the information with any software. My university provides Adobe Photoshop in which I am able to open the video.</p>

<p>Does anyone know a software which enables me to extract that data? Or does someone know how I can do that with Photoshop?</p>

CC BY-SA 4.0
2018-05-24T10:50:32.547Z
A histogram is a representation of the distribution of channel values for the entire picture. You *can't* have a histogram of a single pixel. You might get better search results if you search for "point sample". https://en.wikipedia.org/wiki/Histogram
stib
CC BY-SA 4.0
2018-05-24T14:16:52.857Z
Oh, sorry, that was a terminology mistake of mine. I am looking for the colour information in one spot, as for example the RGB information.
Crystal Lettuce
<software-recommendation><color>
Histogram measurement in single spot
Crystal Lettuce
# Histogram measurement in single spot

(Asked by: username_0 on 2018-05-24)

I have a video that I shot for scientific purposes. I would like to measure the colour information in a single spot and export for example the RGB or CMYK values of that spot through every frame into a text file.

The video itself is a .MOV file which I colour-balanced with a white card. I just couldn't find any information on how to extract the information with any software. My university provides Adobe Photoshop in which I am able to open the video.

Does anyone know a software which enables me to extract that data? Or does someone know how I can do that with Photoshop?

**Tags:** software-recommendation, color

> **Comments:**
> **username_1**: A histogram is a representation of the distribution of channel values for the entire picture. You *can't* have a histogram of a single pixel. You might get better search results if you search for "point sample". https://en.wikipedia.org/wiki/Histogram  
> **username_0**: Oh, sorry, that was a terminology mistake of mine. I am looking for the colour information in one spot, as for example the RGB information.  

---

## 2 answers

### Answer by username_2 on 2018-05-25. Score: 1 | Accepted answer

Using ffmpeg, a free command-line tool, you can do
ffmpeg -i in.mp4 -vf "crop=1:1:234:541:exact=1,tile=50x10,format=rgb24,histogram" out.png

A series of filters are run on the input video.
The crop filter takes each frame and extracts a 1x1 sized window i.e. a single pixel at co-ordinates (234,541) measured from top-left of frame. Numbering starts at 0.
The tile filter collects all of these single pixel frames into a single frame of dimensions 50x10. It is important that the product of these dimensions (500) match the total number of frames in the video. If it's greater, the difference will be black pixels added by the tile filter and throw off your histogram; if less, frames will be skipped. Worst case scenario, your frame count is prime, so you can either do Countx1 or MxN where M*N is count + 1.
The next filter converts the tile output to a RGB pixel format, since videos typically are YUV.
The histogram filter generates a graphical RGB histogram which is saved to a PNG. See the filter doc for options to change layout or image size.


---

### Answer by username_1 on 2018-05-25. Score: 1

The first thing I'd be looking at is [Processing](https://processing.org/). There's a library that lets you read video, there's an example [here](https://processing.org/reference/libraries/video/Movie_read_.html) that shows how to to sequentially grab frames from a video.

Then (instead of displaying the frame like it does in that example) you need to find the channel values for the spot which you could do by copying the frame to a [PImage](https://processing.org/reference/PImage.html). Then the value of the pixel (x,y) is found in the PImage property `pixels[x,y]`. Finally use [createWriter()](https://processing.org/reference/createWriter_.html) to output the data to a file. You could even get fancy and use the mouse to control your sample point, and so on.


---

