context.putImageData darkening semi transparent pixels
Updating a canvas repeatedly using context.getImageData/putImageData will result in darkening of semi transparent pixels.
Instead of reading the image data from the context again and again, keep the original image data and do the transformation on that and draw it on the canvas with putImageData.
Written by Rasmus Bang Grouleff
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Canvas
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#