• Stars
    star
    365
  • Rank 112,695 (Top 3 %)
  • Language
    JavaScript
  • Created over 12 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

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 (mostly c, java and flash, plus a couple from javascript libraries), see the comments in the code for details.

Some image processing/computer vision theory, basics and tutorials (see references):

Features

The library dependencies are:

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)

  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 (previously called NonLinearFilter)
  11. BlendFilter
  12. CompositeFilter (an abstraction of a container stack for multiple filters)
  13. AlgebraicFilter (an abstraction of algebraic combination of images or other filter outputs into an output image, to be added)
  14. InlineFilter (create inline filters dynamicaly at run-time using your custom functions)
  15. DimensionFilter
  16. GLSLFilter glsl-based (webgl/node-gl) analogs of at least some of the generic filters (in progress, possibly in next update)
  17. SVGFilter svg-based filters (todo)
  18. 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, delay etc..) (in progress)
  • add active-shape geometric filters, color/histogram-detector filters, .. (todo)
  • add 2d-fft routines, frequency-domain filtering (todo)
  • add SVG, CSS Filters 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, filter routines) using faster asm.js (browser & nodejs) and/or simd.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/.JPEG etc.. [DONE]
  • add support for Parallel Processing using Web Workers and/or Asynchronous 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]

More Repositories

1

HAAR.js

Feature Detection based on Haar Cascades in JavaScript (Viola-Jones-Lienhart et al Algorithm)
JavaScript
329
star
2

codemirror-grammar

Transform a JSON grammar into a syntax-highlight parser for CodeMirror
JavaScript
79
star
3

MOD3

3D Modifier Library in JavaScript, port of AS3DMod ActionScript 3D Modifier Library
JavaScript
72
star
4

RegexAnalyzer

Regular Expression Analyzer and Composer for JavaScript, PHP, Python
JavaScript
67
star
5

code-optimization-methods

A summary of code optimization methods
41
star
6

ace-grammar

Transform a JSON grammar into a syntax-highlight parser for ACE Editor
JavaScript
35
star
7

modelview.js

A simple, versatile and fast isomorphic MVVM framework for JavaScript (Browser and Server)
JavaScript
21
star
8

Contemplate

Light-weight, fast and extensible object-oriented template engine for PHP, Python and JavaScript (Node.js, Browser, XPCOM)
JavaScript
19
star
9

editor-grammar

invariant codebase of editor-grammar (codemirror-grammar, ace-grammar,prism-grammar,syntaxhighlighter-grammar, highlightjs-grammar,..)
JavaScript
17
star
10

Abacus

Advanced Combinatorics and Algebraic Number Theory Symbolic Computation library for JavaScript, Python
JavaScript
17
star
11

Rubik3

Intuitive 3D Rubik Cube with Three.js
JavaScript
15
star
12

HAARPHP

Feature Detection based on Haar Cascades in PHP (Viola-Jones-Lienhart et al Algorithm)
PHP
14
star
13

as3-transitions-lib

Image Transitions Library for Actionscript 3
AngelScript
13
star
14

HtmlWidget

Html Widgets, made as simple as possible, for Javascript, PHP and Python (Browser and Server, Desktop and Mobile)
PHP
12
star
15

AjaxListener.js

Listen to any AJAX event on page with JavaScript, even by other scripts
JavaScript
11
star
16

Xpresion

Xpresion: simple and flexible Expression Parser Engine with variables support for PHP, Python, JavaScript
PHP
10
star
17

area-select.js

A simple JavaScript class to select rectangular regions in DOM elements (image, canvas, video, etc..)
JavaScript
10
star
18

highlightjs-grammar

Transform a JSON grammar into a syntax-highlight mode for Highlight.js
JavaScript
10
star
19

prism-grammar

Transform a JSON grammar into a syntax-highlighter for Prism
JavaScript
8
star
20

Dialect

Dialect: Cross-Vendor & Cross-Platform SQL Query Bulder for PHP, Python, JavaScript
PHP
8
star
21

Carousel3

HTML5 3D Carousel using Three.js
JavaScript
8
star
22

simple-captcha

Simple, image-based, mathematical captcha, with increasing levels of difficulty for PHP, JavaScript, Python
HTML
8
star
23

GrammarTemplate

GrammarTemplate: versatile and intuitive grammar-based templating for PHP, Python, JavaScript
PHP
8
star
24

PHPDeobfuscator

Generic PHP Deobfuscator and Beautifier Class
PHP
7
star
25

area-sortable.js

Simple and light-weight JavaScript class for handling smooth drag-and-drop sortable items of an area (Desktop and Mobile).
JavaScript
7
star
26

sudoku.js

Simple and fast Sudoku Game, Builder and Solver in pure JavaScript
JavaScript
7
star
27

Geometrize

Computational Geometry and Rendering library for JavaScript
JavaScript
6
star
28

3DFlipBookEngine

Real 3D Flip Book in Actionscript 3
ActionScript
6
star
29

SortingAlgorithms

Sorting Algorithms implementations in JavaScript
JavaScript
6
star
30

tico

Tiny, super-simple but versatile quasi-(M)VC Web Framework for PHP
PHP
6
star
31

touchTouch

An enhanced variation of touchTouch Optimized Mobile Gallery in pure vanilla JavaScript
JavaScript
5
star
32

Imagik

Fully-featured, fully-customisable and extendable Responsive CSS3 Slideshow
JavaScript
5
star
33

syntaxhighlighter-grammar

Transform a grammar in JSON format to a highlight brush for SyntaxHighlighter
JavaScript
5
star
34

classy.js

classy.js: Object-Oriented mini-framework for JavaScript
JavaScript
4
star
35

scripts

Scripts and Tools for Automation Tasks
Shell
4
star
36

InTpl

InTpl: simple php templates supporting template inheritance
PHP
4
star
37

Dromeo

A Simple and Flexible Pattern Routing Framework for PHP, JavaScript, Python
JavaScript
4
star
38

Rasterizer

Rasterize, stroke and fill lines, rectangles, curves and paths. Even without canvas.
JavaScript
4
star
39

Gradient

Class to create linear, radial, conic and elliptic gradients and image patterns as bitmaps without canvas
JavaScript
3
star
40

img2svg

Vectorize Image Data to SVG using potrace algorithm with color
JavaScript
3
star
41

PublishSubscribe

A simple and flexible publish-subscribe pattern implementation for PHP, Python, JavaScript
PHP
3
star
42

jquery-plugins

Collection of custom jQuery plugins
JavaScript
3
star
43

RT

RT.js: unified client-side real-time communication for JavaScript using XHR polling / BOSH / WebSockets / WebRTC
JavaScript
3
star
44

3DRubikCube

Intuitive 3D Rubik Cube in Actionscript 3
ActionScript
3
star
45

flasher

ActionScript 3 XML slideshow based on as3-transitions-lib
ActionScript
3
star
46

Formal

A simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
JavaScript
3
star
47

Paginator

Simple and versatile Pagination utility class for PHP, Python, Node.js / Browser Javascript
JavaScript
2
star
48

Unicache

Universal agnostic caching framework for PHP, Node.js, Browser, Python
JavaScript
2
star
49

Importer

Importer: a simple loader manager for namespaces, classes and assets with dependencies for PHP, Python, JavaScript
JavaScript
2
star
50

LoginManager

Simple, barebones agnostic login manager for PHP, JavaScript, Python
PHP
2
star
51

grid.css

Grid CSS Layout
CSS
2
star
52

Plot.js

Simple chart and function graph plotting library which can render to Canvas, SVG or plain HTML
JavaScript
2
star
53

foo123.github.com

demos and other stuff..
HTML
2
star
54

easyDb.js

Database abstraction layer (DBAL) for Node.js (supports mysql, postgres, sqlite,..)
JavaScript
2
star
55

jquery-ui-widgets

a collection of custom, simple, useful jQueryUI Widgets
JavaScript
2
star
56

Billiard.js

A pure JavaScript billiard game
JavaScript
2
star
57

DialectORM

Tiny, fast, super-simple but versatile Object-Relational-Mapper (ORM) w/ Relationships and Object-NoSql-Mapper, based on Dialect, for PHP, Python, JavaScript
PHP
2
star
58

InfoPopup

A simple JavaScript class to show info popups easily for various items and events (Desktop and Mobile)
HTML
2
star
59

CanvasLite

An html canvas implementation in pure JavaScript
JavaScript
1
star
60

minicarousel

Optimized responsive Carousel for Desktop and Mobile
JavaScript
1
star
61

PatternMatchingAlgorithms

Pattern Matching Algorithms implementations in JavaScript
JavaScript
1
star
62

minislider

Optimized responsive mini slider (up to 12 slides) for Desktop and Mobile
JavaScript
1
star
63

mark-I

markdown viewer and editor firefox add-on
JavaScript
1
star
64

GrammarTree

Grammar to Abstract Syntax Tree (in JSON format) generic parser for JavaScript / Python / PHP
1
star
65

DateX

eXtended and localised Date parsing, diffing, formatting and validation for Node/XPCOM/JS, Python, PHP
JavaScript
1
star
66

svg2json

Parse SVG to JSON
JavaScript
1
star
67

css-color

simple class for manipulating color values and color formats for css, svg, canvas/image
JavaScript
1
star
68

responsive.css

responsive
CSS
1
star
69

Beeld

Beeld: scriptable, extendable and configurable source code builder framework (node.js / php / python platforms)
JavaScript
1
star
70

asynchronous.js

Simple manager for asynchronous, linear, parallel, sequential and interleaved tasks for Node/XPCOM/JS
JavaScript
1
star