0.1.2 • Published 11 months ago

@liquid-js/palette v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Palette

GitHub license npm scope

Get colour palette from an image.

Installation

npm install @liquid-js/palette

API Documentation

https://liquid-js.github.io/palette/

Usage

To obtain colours from an image, use extractImageData and quantize (note: quantize might take a long time to run depending on image size; consider running it asynchronously).

import { extractImageData, quantize } from '@liquid-js/palette'

const imageUrl = 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Peace_Of_Nature_%28129019177%29.jpeg/640px-Peace_Of_Nature_%28129019177%29.jpeg'

const img = new Image()
img.crossOrigin = 'anonymous'
img.addEventListener('load', () => {
    const imageData = extractImageData(img)
    const colors = quantize(imageData)

    console.log(colors)
})
img.src = imageUrl

License

MIT License

0.1.0

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago