This project extracts frames from a video file at regular intervals, computes the average colour for each frame, and creates visualisations of the movie’s colour palette.
- Frames are extracted from a video file (default every 10 seconds).
- Average colour is computed for each frame.
- Visual summaries are generated in 3 styles:
- Horizontal bar: Colours stacked left to right.
- Vertical bar: Colours stacked top to bottom.
- Wave pattern: A quarter-section radial swirl using a sine-based wave distortion.
HDR content is tone-mapped to SDR during frame extraction using ffmpeg.
project-root/ ├── frames/ │ └── Aliens (1986) - tt0090605/ │ ├── frame_0001.jpg │ ├── ... │ └── frame_0824.jpg ├── outputs/ │ └── Aliens (1986) - tt0090605/ │ ├── linear_output.png │ ├── vertical_output.png │ └── debug_output.png ├── colours_of_motion_radial_.py ├── processed_files.json ├── requirements.txt ├── .gitignore └── README.md
Make sure ffmpeg is installed on your system. If you're on macOS:
brew install ffmpegFrom the root of this project:
python3 -m venv .venv
source .venv/bin/activate # macOS/Linux
pip install -r requirements.txtRun the script and follow the prompts:
python colours_of_motion.pyYou will be asked:
-
The full path to the video file (e.g. /Volumes/Media/.../Aliens.mkv)
-
A name to use for the output folder (e.g. Aliens (1986) - tt0090605)
If the video has already been processed, only the output visualisations will be regenerated.
- Outputs are saved to
outputs/<foldername>/. - Frame data is not committed, only final images.
- Uses
ffmpeg,Pillow,OpenCV, andnumpy.
Below is an example of the outputs generated from:
🎬 Aliens (1986) - Theatrical Cut
• HDR sources are tone-mapped to SDR using Hable tonemapping and BT.709 output profile
• Frame extraction happens at 0.1 fps (~1 frame every 10 seconds)
• Outputs are stored in /outputs/your-folder-name
Project concept inspired by The Colours of Motion, visualising the emotional palette of cinema.
%20-%20tt0090605/radial.png)
%20-%20tt0090605/linear.png)