inssein / jsfx

Javascript image effects library
https://jsfx.inssein.com
MIT License
33 stars 3 forks source link

Improve Performance #1

Open inssein opened 9 years ago

inssein commented 9 years ago

Currently, the filters get applied serially, which isn't a problem for WebGL, but can be a pain point for Canvas.

Thoughts: Think of a way to refactor the application of filters so that the canvas renderer only loops through all the pixels once (where possible), and the effects get applied at each pixel.

This will also allow for the added benefit of breaking up all the adjustment filters. Instead of doing both Hue and Saturation in one filter, we can break it up and not take a performance penalty.

inssein commented 9 years ago

Addressed by https://github.com/inssein/jsfx/commit/53bff202bf27de4f6767177213c02269b4cdcba1 for Canvas. Need to get ideas for implementing IterableFilters for WebGL (Generating shaders for combination of effects?)