
PhoneGap By Example
By :

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.
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 logic
pixastic.effects.js
: This file affects logic and pixel processing
pixastic.worker.control.js
: This is used as the control of the worker
pixastic.worker.js
: This is the worker file itself
Here is a simple example of the Pixastic library usage, which we will...
Change the font size
Change margin width
Change background colour