FILTER.js
                                
                                
                                
                                    FILTER.js copied to clipboard
                            
                            
                            
                        Video and Image Processing and Computer Vision Library in pure JavaScript (Browser and Node.js)
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, WebWorkers, WebGL and SVG (in progress) or analogs in Node.js.
version 0.9.6
- filter.core.js / filter.core.min.js
 - filter.io.js / filter.io.min.js
 - filter.codecs.js / filter.codecs.min.js
 - filter.filters.js / filter.filters.min.js
 - filter.plugins.js / filter.plugins.min.js
 - filter.bundle.js, filter+io+codecs+filters+plugins+dependencies
 
see also:
- Abacus advanced Combinatorics and Algebraic Number Theory Symbolic Computation library for JavaScript, Python
 - Plot.js simple and small library which can plot graphs of functions and various simple charts and can render to Canvas, SVG and plain HTML
 - HAAR.js image feature detection based on Haar Cascades in JavaScript (Viola-Jones-Lienhart et al Algorithm)
 - HAARPHP image feature detection based on Haar Cascades in PHP (Viola-Jones-Lienhart et al Algorithm)
 - FILTER.js video and image processing and computer vision Library in pure JavaScript (browser and node)
 - Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
 - Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python
 - GrammarTemplate grammar-based templating for PHP, JavaScript, Python
 - codemirror-grammar transform a formal grammar in JSON format into a syntax-highlight parser for CodeMirror editor
 - ace-grammar transform a formal grammar in JSON format into a syntax-highlight parser for ACE editor
 - prism-grammar transform a formal grammar in JSON format into a syntax-highlighter for Prism code highlighter
 - highlightjs-grammar transform a formal grammar in JSON format into a syntax-highlight mode for Highlight.js code highlighter
 - syntaxhighlighter-grammar transform a formal grammar in JSON format to a highlight brush for SyntaxHighlighter code highlighter
 - SortingAlgorithms implementations of Sorting Algorithms in JavaScript
 - PatternMatchingAlgorithms implementations of Pattern Matching Algorithms in JavaScript
 
Contents
- Live Examples
 - Browser Support
 - Credits
 - References
 - Features
 - API Reference
 - ChangeLog
 - Todo
 
Live Examples
- Image Processing with 
Filter.js - Video Processing with 
Filter.js - Sound Visualization with 
Filter.js(Trioptic) Filter.jswithThree.jsFilter.jsinNode.js
Browser Support
 
 
 
 
Credits
Some filters code has been adapted from open source libraries (mostly c, java and flash, plus a couple from javascript libraries), see the comments in the code for details.
- Image Processing Library in Java
 - AS3 Image Processing Library
 - AS3 ColorMatrix by @GSkinner
 - Simplex Noise and Perlin Noise by Stefan Gustavson
 - glfx.js
 - JViolaJones, HAAR.js
 - OpenCV, HAAR cascades
 - zlib (
asm.jsemscripten version) - ffmpeg (
asm.jsemscripten version) 
Some image processing/computer vision theory, basics and tutorials (see references):
- light, color, perception and color space theory
 - the influence of history & culture on visual perception
 - a beginners guide to bitmaps by Paul Burke
 - OpenCV, open source computer vision
 - General-purpose GPU Scientific Computing (..moving towards)
 
Features
The library dependencies are:
- Classy.js micro Object-Oriented framework.
 - Asynchronous simple manager for async/parallel tasks.
 
The framework defines an Image Proxy class, which represents an Image, a number of utilities like Color Class, Image Loader classes, Image Codecs, and 17 generic Filter types (some having glsl/svg analogs) plus various Plugins and Extra filters (with support for parallel processing transparently both for browser and nodejs)
- AbstractFilter
 - ColorTableFilter
 - ColorMatrixFilter (analogous to the ActionScript filter)
 - ColorMapFilter
 - AffineMatrixFilter
 - GeometricMapFilter
 - DisplacementMapFilter (analogous to ActionScript filter)
 - ConvolutionMatrixFilter (analogous to the ActionScript filter)
 - MorphologicalFilter
 - StatisticalFilter  (previously called 
NonLinearFilter) - BlendFilter
 - CompositeFilter (an abstraction of a container stack for multiple filters)
 - AlgebraicFilter (an abstraction of algebraic combination of images or other filter outputs into an output image, to be added)
 - InlineFilter (create inline filters dynamicaly at run-time using your custom functions)
 - DimensionFilter
 - GLSLFilter glsl-based (
webgl/node-gl) analogs of at least some of the generic filters (in progress, possibly in next update) - SVGFilter svg-based filters (todo)
 - Plugins (a number of plugin filters which cover a wide(r) 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)
Parallel Processing Support (browser and node) (support parallel procesing/filtering with filter workers in an intuitive and transparent way, see examples)
GPU Processing Support (browser and node, in progress) (support GPU-based parallel procesing/filtering with glsl filters in an intuitive and transparent way)
Image Blending Modes (analogous to PhotoShop blend modes)
The filters, and the way they operate, naturaly represent a system of interconnected nodes which process and interchange (image) data (not necesarily synchronously), a.k.a a signal processing graph system. The result is a streamlined flow for image processing and computer vision in JavaScript.
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(s) to include your own selection of filters and plugins for your custom build
Todo
- add 
GLSL(webgl/node-gl) support for various generic Filters (in progress, possibly in next update) - add some needed signal processing graph node filters (eg 
algebraic,switch,delayetc..) (in progress) - add active-shape geometric filters, color/histogram-detector filters, .. (todo)
 - add 
2d-fftroutines, frequency-domain filtering (todo) - add 
SVG,CSSFilters interface support for some Filters (todo) - add machine learning (image) segmentation/clustering algorithms (e.g 
kmeans,kmedoids,connected components,deterministic annealing,svd,jade, ..) [DONE partially] - implement some numeric routines (e.g 
blas,filterroutines) using fasterasm.js(browser & nodejs) and/orsimd.js[DONE partially] - make convolutions/statistics faster [DONE partially]
 - add full support for 
Node.js[DONE] - add (generic/native) codec support for image formats, e.g 
.TGA,.HDR/.RGBE,.GIF,.BMP,.PNG,.JPG/.JPEGetc.. [DONE] - add support for 
Parallel ProcessingusingWeb Workersand/orAsynchronous Processing[DONE] - use fixed-point arithmetic, micro-optimizations where possible [DONE]
 - add caching of filter parameters where applicable [DONE]
 - increase performance for 
Opera,IE[DONE partially] 


