Book Image

PhoneGap By Example

Book Image

PhoneGap By Example

Overview of this book

Table of Contents (17 chapters)
PhoneGap By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

An overview of the Pixastic library


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 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...