I am working on an application in which an image is created/edited on a HTML5 canvas and then saved into a file-store/cloud. The problem is that of \"saving efficiency\". On sav
HTML:
SCRIPT:
isCanvasTransparent(document.getElementById("canvas_img"));
function isCanvasTransparent(canvas) { // true if all pixels Alpha equals to zero
var ctx=canvas.getContext("2d");
var imageData=ctx.getImageData(0,0,canvas.offsetWidth,canvas.offsetHeight);
for(var i=0;i
UPDATE:
Dont use CSS style declarations like border: 1px solid black;
for CANVAS
, because border included into canvas image, and, as result, alpha chanel is always not equals to zero.