You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The value of the color marked as transparent is not discarded, but blended with background using "add" operation if the background isn't transparent.
For example, here is an image that is transparent, but the color of the transparent index in it's palette is set to #804000:
varassert=require('assert')varCanvas=require('canvas')varc=newCanvas(150,150)varctx=c.getContext('2d')// fill background with something non-transparentctx.fillStyle='rgb(0, 100, 200)'ctx.fillRect(0,0,150,150)// load the (supposedly) transparent gifvari=newCanvas.Image()i.src='transparent.gif'// https://i.imgur.com/XCz0eVi.gif// draw it on top of our backgroundctx.drawImage(i,0,0)// expect no visible change in the canvasvarpixel=ctx.getImageData(0,0,1,1).dataassert.deepEqual(pixel,[0,100,200,255])
The text was updated successfully, but these errors were encountered:
The value of the color marked as transparent is not discarded, but blended with background using "add" operation if the background isn't transparent.
For example, here is an image that is transparent, but the color of the transparent index in it's palette is set to
#804000
:The text was updated successfully, but these errors were encountered: