I tried to find some relevant sources about this and found nothing.
So, my questions are quite simple. Is canvas faster than img? I will use object as in img (png, gif) or canvas.
I am interested in memory usage, performance in browser and in loading speed.
edit#1: canvas is drawn by js and it will be same as image in img tag.
No, img
is faster, easier to create and more accessible than using canvas
. The img
tag was designed to show an image so if that's all you need to do, use an img
tag. Multiple uses shouldn't matter as the image will only be downloaded once.
If you need some animation or interactivity, that is the time to consider canvas
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With