So if there is someone who has no problem to write code to read the color pixels. for example:
I need to load the image in canvas element. read red, green and blue values of pixel located at (26x30) in gs.png
- Code: Select all
<html>
<head>
<script type="application/x-javascript">
function draw() {
var ctx = document.getElementById('canvas').getContext('2d');
var img = new Image();
img.src = 'gs.png';
img.onload = function()
{
var data = imgd.getImageData(26, 30, 1, 1).data;
var color = new Color([data[0], data[1], data[2]]);
}
}
</script>
</head>
<body onLoad="draw();">
<canvas id="canvas" width="180" height="130"></canvas>
<img src="gs.png"/>
</body>
</html>
I need answer in alert, new variable, whatever...
THX