Home

Awesome

FILTER.js

A pure JavaScript Library for Image/Video Processing, Filtering and Computer Vision

This is a library for processing images/video in pure JavaScript using HTML5 features like Canvas, Web Workers, WebAssembly and WebGL or alternatives in Node.js (eg CanvasLite, node-canvas, node-gl, node processes).

version 1.11.0 in progress (396kB minified)

Contents

Filter.js Filter.js Filter.js

Live Examples

Browser Support

firefox chrome opera ie nodejs

Credits

Some filters code has been adapted from open source libraries, see the comments in the code for details.

Features

The framework defines an Image class, which represents a proxy for an Image, a number of utilities like Color class and 14 generic Filter types plus various Plugins and Extra filters (with support for (low-level) CPU and GPU parallel processing transparently both for browser and nodejs)

  1. AbstractFilter
  2. ColorTableFilter
  3. ColorMatrixFilter (analogous to the ActionScript filter)
  4. ColorMapFilter
  5. AffineMatrixFilter
  6. GeometricMapFilter
  7. DisplacementMapFilter (analogous to ActionScript filter)
  8. ConvolutionMatrixFilter (analogous to the ActionScript filter)
  9. MorphologicalFilter
  10. StatisticalFilter
  11. BlendFilter
  12. DimensionFilter
  13. CompositeFilter (an abstraction of a container for multiple filters)
  14. InlineFilter (create inline filters dynamically at run-time using your custom functions)
  15. FrequencyFilter (frequency domain filters)
  16. Extra Filters (extra filters which cover a wider range of functionality and use cases)

Each of the generic filters is prototype but it also includes a number of implementation filters like grayscale , colorize , threshold , gaussBlur , laplace , emboss , gamma, twirl and so on.. (depending on type of filter)

CPU Parallel Processing for browser and nodejs: support CPU parallel procesing with filter Workers in an intuitive and transparent way, see examples.

GPU Parallel Processing for browser and nodejs: support GPU/WebGL parallel procesing with GLSL filters in an intuitive and transparent way, see examples.

Mix CPU/GPU filters transparently

Fast CPU Assembly Code for browser and nodejs: support assembly coded filters, see examples.

Map/Reduce functionality

Image Blending Modes (analogous to SVG blend modes)

TIP: You can create your custom build of the library with the filters/plugins you choose. Each filter and plugin is independent and can be used in a mix-n-match manner, as long as the core classes are always included. Change the dependencies file to include your own selection of filters and plugins for your custom build

Todo

see also: