Friday 19 May 2017

How to get pixel at position in base64 PNG

How to get the pixel color at a coordinate from a base64 png image data?

driver.takeScreenshot().then(
    function(image, err) {
        require('fs').writeFile('out.png', image, 'base64', function(err) {
           console.log(err)
        });
       getPixelColorAt(40, 500, image)
    }
);

function getPixelColorAt(x,y,data) {
//should return an Hexadecimal value
}



via TSR

No comments:

Post a Comment