Benefit to use canvas instead of img?
问题 i am currently building a mobile app and i'm just wondering if it's better (performance wise) to use canvas or img tags. i'll be querying my website for the actual image. just wondering if there is a benefit of one over the other. 回答1: The main benefit is to avoid unnecessary browser decode. For browsers to paint an image onto screen, they would need to: Retrieve the encoded contents of the image file Decode the image from its original JPEG, GIF, PNG or WebP format to a bitmap in memory Paint