I’m currently working on a photography website project. Something I wanted to explore was how much data it is possible to extract from a simple set of photos, with the potential to later use this data for various visualizations.
Dribble — a website for designers to post views of their latest works — displays a colour palette of the most common colours for each image. These images can then be used as a tag for users to browse images by color.
This seems like a very useful piece of data to maintain for images and it’s possible with RMagick.
To return the n most common colors in hex format, providing the filesystem path of the image: