Skip to content

felixschwebel/ImageColorPaletteGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageColorPaletteGenerator

A web application for generating a color palette from an image. The user can upload an image and use the “Get Palette”-button to display the 10 most common colors of that image.

Screenshot 2022-12-27 at 21 25 08

I used the Flask framework with Jinja templating to implement all the functions into the HTML code.

Screenshot 2022-12-27 at 21 25 58

To get the colors of the image I used the NumPy library. The image is imported as a narray and flattened with the reshape function.

Screenshot 2022-12-27 at 21 26 58

Because there are many different shades of nearly the same color, I used the histogram function with 10 bins. The indices that are returned from the histogram are used to get the RGB values.

Screenshot 2022-12-27 at 21 27 13

These RBG-color codes are then converted into hex-color-coding.

Screenshot 2022-12-27 at 21 27 37

Because I needed 2 colors in every row for my HTML frame, I converted the list into a list which contains 5 lists with 2 values each.

Screenshot 2022-12-27 at 21 27 26

About

An application that generates a color palette with the 10 most common colors in a picture.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published