I'm looking into ways to efficiently access an images pixel coordinates and RGBA values. My js knowledge is way out of date and I have never used used C3's js scripting.
Before I go too deep into trying this, I was hoping someone could give an indication of whether it would work in C3 or not?
MarvinJ is a pure javascript image processing framework:
Script here: marvinj.org/releases/marvinj-0.7.js
The code I think would be useful to do an Alpha comparison per pixel is demonstrated here:
image = new MarvinImage();
image.load("yourimage.png", imageLoaded);
function imageLoaded(){
console.log("(0,0): "+(image.getAlphaComponent(0,0) > 0 ? "NOT_TRANSPARENT" : "TRANSPARENT"));
console.log("(150,150): "+(image.getAlphaComponent(150,150) > 0 ? "NOT_TRANSPARENT" : "TRANSPARENT"));
}
Any hints/tips are greatly appreciated