Wednesday, November 18, 2015

Calculating video frame average color and displaying its name

This little demo shows how to calculate the average color value of a video frame during playback. 
The color name is displayed as well as the color value. 
This can be useful when creating 508 accessible content, for example for color blinded people. 

I used the colorThief library for calculating the average color. 
Note that you can also calculate the frame average palette if you need to display more colors, 
however this results in slower performances.
After getting the color value, I use the "Name that color" library by Chirag Mehta to display the color name.

You can view the source code for this demo by right-clicking the demo and choosing "View Frame Source".


About Me

My photo
I've been developing Internet and rich-media application for 15 years. In my work I emphasis usability and best user experience as well as sleek design. My main expertise are JavaScript, Flex and Flash.

Followers