javascript - Issues with canvas.getContext("2d").getImageData(x,y,1,1).data in chrome and firefox -
recently have been programming , have run across inconsistencies between browsers document.getelementbyid(canvasid).getcontext("2d").getimagedata(x, y, 1, 1).data;
command. have image , section of image colored rgb(246,247,247) (i set color in photoshop). calling getimagedata
method image data @ clicked point, @ color , if color inside range (which have defined in array) plot point on area. run in ie , works expected, color comes out @ rgb(246,247,247). problem comes in when run exact same code exact same image in chrome or firefox, browser says color rgb(246,247,246) , rgb(246,247,246), respectively. why browser saying colors different are? there way color of pixel in canvas reliably? in advance!
for record, web browsers render colors differently. best way ensure colors same use web safe colors, , export images png-8 no gamma channel.
Comments
Post a Comment