Such a canonical attribute would solve different problems we currently have with the web platform:
- Authors currently refrain from using more efficient image formats like WebP due to interop problems when people share or download these images: If the addressee does not have a WebP capable client, she/he cannot open the image. Same goes for software like Photoshop. With the canonical attribute, the image downloaded would not be the one currently being displayed but the one specified in the attribute:
<img src=“example.webp” canonical=“example.jpg”>
-
The attribute would help in a similar way for when srcset or a picture element are active and the browser displays a slimmed down version out of the set. Again, when sharing or saving, the canonical attribute would ensure that the unoptimized image would be used for that.
-
And finally authors that use tricks to keep people from downloading an image, like using a transparent image with the original image as CSS background-image or blocking right mouse clicks via JavaScript, could use the canonical attribute to point to a low res file or to a file with watermark or to just a blank image. No need to overengineer something any more.