GithubHelp home page GithubHelp logo

aqsahassan / color-extractor-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mikethewatchguy/color-extractor-service

0.0 1.0 0.0 595 KB

Extract a color palette from an image.

Home Page: https://colors.rmotr.com/

Python 25.67% JavaScript 26.39% HTML 22.93% CSS 25.01%

color-extractor-service's Introduction

Color Palette extraction (as a service)

Live Demo

This is a simple project to demonstrate the usage of unsupervised Machine Learning methods (clustering with scikit-learn KMeans) to extract colors from images.

How it works

Theres a Jupyter Notebook with a step by step explanation in this same repo: demo/Extract colors from images.ipynb

Usage

There's a simple API endpoint to use it as a service: /api/extract. It accepts two different types of requests:

Providing a URL

A JSON POST request with two parameters:

  • url (mandatory): The URL of the picture to extract colors from
  • clusters (optional): The number of clusters to use (default=6)
Example:
$ curl -X POST -d '{"url": "https://images.unsplash.com/photo-1536506591919-966afe6f7c09?fit=crop&w=750&q=80"}' -H "Content-Type: application/json" https://colors.rmotr.com/api/extract

Providing a File

A multipart/form-data request with two form values:

  • file (mandatory): The image file to extract colors from
  • clusters (optional): The number of clusters to use (default=6)
Example
$ curl -X POST -F "file=@demo/sample-image-1.jpg" -F "clusters=7" http://localhost:5000/api/extract

Authors

Frontend magic by:

Image Credits

Sample images from unsplash:

color-extractor-service's People

Contributors

matiascaputti avatar santiagobasulto avatar

Watchers

 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.