GithubHelp home page GithubHelp logo

calamity34 / palette_compression Goto Github PK

View Code? Open in Web Editor NEW

This project forked from volyomas/palette_compression

3.0 2.0 0.0 6.49 MB

Script compressing the color pallette on an image using KMeans

Python 100.00%
kmeans-clustering python quantization

palette_compression's Introduction

Palette Compression


This script can compress the color palette of your image using ML algorithms (KMeans and DBSCAN).\

Installation requires you to have poetry installed via pip, to install you need to run poetry install in the folder, then poetry shell to get into the venv.

You can run this script like this:
python -m palette_compression <filename> [colors=2] [use DBSCAN=N/y]

For example:
python -m palette_compression armstrong.png 7

DBScan is broken

DBSCAN method is currently broken. Images have artifacts, if you can fix it - PLEASE drop a PR.
Here's a comparison of timings, also look in the imgs/ folder to see the results:
difference

More examples can be seen in samples.md

palette_compression's People

Contributors

voidlynx avatar volyomas avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.