/swatch

Python program that processes videos or images to create a color palette.

Primary LanguagePythonMIT LicenseMIT

Swatch

Swatch is a quick project idea I came up with while reading about color theory and film. It has two main features; image and video processing. By inputting an image, the user can find the average color for that image, as well as the average color by row or average color by column (rows and columns in reference to the rows and columns of pixels that make up the image). By inputting a video file, the program parses through the frames of a video and generates the average color for each frame. Then, it creates a color palette using all of those average colors. This repo comes with sample images and videos to use swatch on.

Image Demo

Example of Swatch on Vermeer's View of Delft:

Source Image:

alt text

Average Color:

alt text

Average Color by Row:

alt text

Average Color by Column:

alt text

Video/Movie Demos

Example of Swatch on Christopher Nolan's Inception (2010):

alt text

Example of Swatch on Pixar's Inside Out (2015):

alt text

Getting Started

Swatch runs on Python 3.x. You can download Python here.

Prerequisites

Swatch uses a few libraries:

pillow
numpy
opencv
imageio

You can install these libraries using pip. Here is a guide.

Installing

To install swatch after all the prerequisites have been installed, follow these steps:

  1. Clone this repo:
git clone git@github.com:shaikat9000/swatch.git
  1. Go into the /swatch directory:
cd swatch
  1. Run swatch:
python swatch.py

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Artists and coders everywhere.
  • Great teachers and professors!
  • Codacken - for the name