Color Frequency Palette

View on GitHub Download ZIP

Prerequisites:

To run:

  1. Clone the repository by running the following in your machine’s terminal:
    git clone https://github.com/cadedupont/color-frequency-palette.git
  2. Navigate to the directory containing the Makefile, which is the root directory of the project
  3. Run make to compile the program and generate the executable
  4. Run ./color_frequency <image_file> from the root directory to run the program on the image of your choice (include file extension but exclude file path)

Included in the res/in directory are some sample images of album covers I used to test the program. The program is hardcoded to look inside the res/in directory for the image file, so if you want to use your own image, you’ll need to move it into that directory.

Output:

The program will generate two files in the res/out directory:

  1. <image_file_name>.jpg - a 1000x1000 image containing a palette of the 100 most frequent colors found in the provided image, with each color’s hex code written on their respective block in the palette
  2. <image_file_name>.csv - a csv file containing every color’s RGB values, hex code, and frequency in the original image (sorted by frequency in descending order)

Examples:

Album Cover

Input Image

Output Image

Lahai - Sampha

Wish You Were Here - Pink Floyd

American Love Call - Durand Jones & The Indications

This Old Dog - Mac DeMarco

Pico Icon