<img><canvas> 的width和height

css 属性的 width 为最终显示的 css 尺寸
img中,html 属性表示显示的图像尺寸,而在 canvas 中表示 canvas 源尺寸(相当于 img 的naturalWidth),在 canvas 中绘制是基于这个尺寸
props(js)中的 width 为 html 属性的引用
props(js)中的 naturalWidth 表示图像源尺寸(只读),new Image 即可读取(new Image在指定 src 的图像的 width 跟这个一样)。

高清屏 image 有sizes属性。
canvas 只能通过获取 window 的 devicePixelRatio 属性来设置 canvas 的 width(非css像素)