} // document.write("something worked
"); var canvas = document.getElementById("canvas"); //canvas.width = image.width; //canvas.height = image.height; var ctx = canvas.getContext("2d"); } function getPixel(imageData, x, y) { var r, g, b, a, rgb, offset = x * 4 + y * 4 * imageData.width; r = imageData.data[offset]; g = imageData.data[offset + 1]; b = imageData.data[offset + 2]; a = imageData.data[offset + 3]; var wave, maxval, minval; maxval=0.5; minval=-0.5; if(a==0){ wave="outside range"; } else{ wave=((a-192)/63)*(maxval-minval)+minval; } //return "wave height is:" + wave; return "rgba(" + r + "," + g + "," + b + "," + a + ")"; //return "wave = "+wave.toFixed(2)+ "m"; } -->