We would like to easily apply image filters to the pictures we get from the camera on our device. After some research on the Web, I was able to find an awesome library named Pixastic.
Tip
You can download the latest library files from the GitHub repository at https://github.com/jseidelin/pixastic.
It uses HTML5 Canvas for image processing. There are different scenarios for the library usage, but I selected the one with web workers. A web worker is a JavaScript code running in the background without blocking the web page and without affecting the performance of the page. For me, it seems to work best for mobile devices. There are four main files needed:
pixastic.js
: This is the main file with basic logicpixastic.effects.js
: This file affects logic and pixel processingpixastic.worker.control.js
: This is used as the control of the workerpixastic.worker.js
: This is the worker file itself
Here is a simple example of the Pixastic library usage, which we will...