col

colorgram

Color extraction library

Showing:

Popularity

Downloads/wk

28

GitHub Stars

47

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

0.9KB

License

MIT

Type Definitions

Built-In

Tree-Shakeable

Yes?

Categories

Readme

Colorgram Build Status

Color extraction library. In TypeScript/JavaScript. For browser/server.

Demo

test/browser_test.html

Features

  • small size, 1kB (minified + gzipped)
  • pretty fast, 512×512 pixels in ~50ms, 340×340 pixels in ~15ms (~6× slower on mobile)
  • scans every pixel
  • identical output for rotated images
  • sampled by top 2 bits of 3 groups: H, L, and luminance
  • calculates average per group
  • fixed memory footprint, samples using 2 (bits) ^ 3 (groups) 4 (RGB + count) 4 (Uint32) = 1024 bytes
  • usually generates small (~16 colors) palette of main colors
  • supports RGB and RGBA input pixel array (compatible with ImageData.data)
  • using TypedArray
  • no native dependencies

Similar stuff

Install

npm install colorgram

Usage

See test folder.

TypeScript documentation

http://darosh.github.io/colorgram-js/doc/

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial