Google has clarified in its image search help documentation that images are only extracted from the src attribute of img tags in Google Search. This is not new, but Google decided to update its documentation based on some questions it received about the topic.
The new line reads:
Google Search supports images referenced in the src attribute of img in the following file formats: BMP, GIF, JPEG, PNG, WebP, and SVG. It's also a good idea to have the extension of your filename match with the file type.
The previous version read:
Google Search supports images in the following formats: BMP, GIF, JPEG, PNG, WebP, and SVG. It's also a good idea to have the extension of your filename match with the file type.
Google explained, "While not a new change, we occasionally get questions about what HTML elements Google Search can extract images from."
So again, this is not new behavior from Google Search but just a clarification on how Google Search works with images, if you weren't aware.
Forum discussion at X.