Skip to content

mademast/colorsquash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

24bit RGB 256 color Indexed
a small dog laying on a concrete floor in an industrial building the same image in 256 color. there are some visual differences, but the two images look very similar

Important

This crate isn't quite ready yet. There's some tuning and research to be done while selecting the palette. To get the best results you'll likely have to do some trial and error with the tolerance for your specific application.

colorsquash is a colour quantization1 crate and algorithm.

At it's core, it sorts the colors of an image by how frequently they appear, greatest to least. It then goes through those colours and takes the top N colours that are sufficiently different.

features

kmeans - use kmeans for palette selection instead of sort & select.
gifed - adds the Squasher::palette_gifed() method allowing you to directly get a gifed's Palette struct.

squash

A CLI tool to quantize colours :D

Accepts JPEG and PNG as input and can output indexed PNG and GIF.

Footnotes

  1. wikipedia: color quantization

About

Color quantization crate for Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages