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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -