A simple library that calculates the average color of any images or videos in browser environment.
- Bet on speed
- Some algorithms: simple, sqrt (default) and dominant
- Small bundle size, tree shaking
- Average color can be obtained from:
- image
- string (url of image)
- video
- canvas
- array of numbers,
Uint8Array
orUint8ClampedArray
- Average color can be obtained from specific part of resource
- Support for transparency (PNG, SVG and other formats)
- Support for web workers
- Support for Node.js
The crossOrigin attribute allows images that are loaded from external origins to be used in canvas like the one they were being loaded from the current origin. Using images without CORS approval taints the canvas. Once a canvas has been tainted, you can no longer pull data back out of the canvas. By loading the canvas from cross origin domain, you are tainting the canvas.
You can prevent this by setting crossorigin="anonymous".
- Background
- Box shadow
- Box shadow, 4 sides
- Border
- Gallery
- Gradient
- Gradient as stripes
- Canvas
- Text photo
- Ambilight
- Define the average color for your images
MIT License