Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do image processing with Phonegap in JavaScript

I want to know how to manipulate pixels like what we can do within the C# code in JavaScript with Phonegap lib.

I am not sure whether it is possible. So far what I have found is nothing related to image processing in the Phonegap library.(It does provide Image, Capture helper to do something, but it's not enough.)

When I say manipulate pixels it's not about the simple methods like crop, resize, rotate etc. it should down to the level of having access of individual pixels in an image so more complicated computation can be conducted.

Thank you.

PS: guys thank you for leaving "-1", please give your reasons at the same time. thx

like image 777
Franva Avatar asked Jul 31 '13 05:07

Franva


2 Answers

Since is javascript, is done the same you would do it on a browser: using <canvas>

Here is fastCanvas, a phonegap plugin for using it. I haven't use it, but I hope is actually useful.

like image 195
chris-l Avatar answered Oct 02 '22 23:10

chris-l


@chris is right. Because you're running Javacript you can use anyway JS libraries that you used on desktop. For example, I use CamanJS (http://camanjs.com/) to apply some filters in my Phonegap App. It's easy to use and works well. But don't forget that you are running JS on a mobile device. Mobile devices haven't the same computing power as desktops...

like image 34
David Avatar answered Oct 02 '22 23:10

David