Skip to content

A small C program to change an image's colors to a fixed palette

License

Notifications You must be signed in to change notification settings

GuiArcencio/Paletter

Repository files navigation

Paletter

A little pet project born out of quarantine boredom.

Do you have a nice picture and a cool palette and want to mix them up? Your solution is here! Use Paletter to make all colors in your image turn into one of the colors in the palette, minimizing their "color difference".

Compiling

With gcc installed on your machine, simply run:

make all

in the repository's root directory.

Usage

To use Paletter, you will need an image file and a CSV file that contains the hexcode of each color in your palette, separated by commas. Then, run:

./paletter <path-to-image-file> <path-to-csv-file> <output-file>

Or, if you use Windows, you might have to rename the file "paletter.exe", and then run:

paletter.exe <path-to-image-file> <path-to-csv-file> <output-file>

There are four supported output formats:

  • PNG (.png)
  • JPG (.jpg, .jpeg, .jpe, .jif, .jfif, .jfi)
  • BMP (.bmp, .dib)
  • TGA (.tga, .targa, .tpic)

Example

Using the following palette:

54478c,2c699a,048ba8,0db39e,16db93,83e377,b9e769,efea5a,f1c453,f29e4c

The original and paletted pictures are seen below:

I've put a number of palettes you can play with in the examples/palettes folder.

Libraries

I'm using three of Sean Barrett's amazing single-file libraries for image manipulation and dynamic arrays. Go check them out!

About

A small C program to change an image's colors to a fixed palette

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published