Pelgine - Search Pixel Art by Color Palette

Visit Pelgine

Pelgine is a tool that allows you to search pixel art by color palette. As an artist, you may want to understand how a particular color palette is utilized, find an old piece that you can't remember the title of, or simply be amused by exploring the space of artworks in a new way.

I'm currently in the process writing an article on how Pelgine works, but the gist of it is to define the distance between two color palettes that is compatible with the fast search data structure called k-d tree; I'll leave a link here to the blog post once that is completed.

Let me know what you think. I do plan on improving Pelgine by adding new datasets to search (clothing, sprites, website layouts, ...); In addition, I will add a section to extract a color palette from an input image, and another to generate random color palettes. In general, I want the website to be a hub of color related tools for artists.

So the algorithm is taking the main 5 colours of each image, building a k-d tree in 15 dimensions for the whole dataset and then searching for the nearest points?

Some general feedback:

  1. It'd be nice to have Pinterest-like UI with piece titles and other basic info displayed.
  2. It'd be nice to have other colour choosers, preferably some perceptual ones. CAM16UCS to RGB conversion isn't very complex, for example.
  3. It'd be nice to have links to the original source.


Thanks for the suggestions.

Pretty close; It does come down to a search in 15 dimensions. For each artwork, I extracted a 5 color palette. I represented color palettes as a collection of 5 Lab space points.

The definition of color palette distance is the minimum pointwise sum of Euclidean distances between the two palette. You can imagine one palette as fixed, and the other being shuffled in different order until the minimum distance is achieved.

Of course, this is too slow to do across the entire dataset. However, the definition above can be computed efficiently if you put all the palette permutations in a k-d tree (5 factorial (120) such permutations for each color palette). You must convert each of the palette permutations into a point in 15 dimensions for this to work out.

If you did not put all permutations of the palette inside the k-d tree, your search would be dependent on the order of the palette, which is not desirable.

The tool is amazing!

This post is deleted!