Should you embed alt text inside image metadata?
Not everyone can see the images you post online. They may have vision problems, they may have a slow connection, or they might be using a text-only browser. How can we let them know what the image shows? The answer is alt text. In HTML we can add a snippet of text to aid accessibility.
For example <img src="monalisa.jpg" alt="A painting of the Mona Lisa.">
Most social networks will let users add alt text to help describe their images. Brilliant!
But... People don't always add alt text when they upload an image. They may not realise it is helpful, or they don't know how to write a good description, or they may not have time to write something suitable. This leads to a frequently asked question: "Should I embed the alt text inside the image file? That way, whenever people share the image the alt text will automatically be attached!"
Here's my attempt to answer that.
Short answer
No.
Long answer
Nooooooooooooo!
Reasoned Answer
It is complicated.
On a technical level, yes. Most modern image formats allow you to add image metadata - known as EXIF. This EXIF commonly contains GPS location, timestamps, make and model of camera, etc. Here's an example from one of my photos:
There are a pre-defined list of acceptable EXIF tags one of which is "ImageDescription", which is defined as:
A character string giving the title of the image. It may be a comment such as "1988 company picnic" or the like. Two-byte character codes cannot be used. When a 2-byte code is necessary, the Exif Private tag UserComment is to be used.
So, there you have it. Yes you can embed text inside an image. With the right software you can read it. So, technically, you can stuff alt text in there and have a website automatically add it to the alt
attribute.
But this is only half the story. What an image represents is highly context dependent.
In her article about using AI to automatically provide image captions, Léonie Watson makes that point that alt text needs to be:
provided by a content author who knows exactly what's in the image, why its being used and the context its being used in.
Take this very real photo of a famous actress who I just got an AI to dream up.
What's a suitable alt text for this image?
- Famous actress Claire Flumptron standing on the red carpet.
- Claire Flumptron shows off her brand new arm tattoo which has strange mystic runes covering her forearm.
- Designer Giovanni Tuccini's new red dress has a small strap over the shoulder.
- AI image where the hand is strangely deformed and the neck looks twisted beyond human endurance.
- Smiling woman with cropped blonde hair and heavy eye makeup.
- Last known photo of the Mayor (right). His blurry face is smiling.
- ...
There's no "right" answer. It depends on what the image is being used to illustrate.
A picture may be worth a thousand words. But those thousand words depend on context.
For more information on writing good alt text, see Harvard's Digital Accessibility blog and Design102's guide.
Gareth Kitchen said on stroud.social:
@Edent It's also worth remembering that the instance admin (on Akkoma at least) can configure Exif data to be stripped out.
https://akkoma.dev/AkkomaGang/akkoma/commit/c06a5af386a3cdfeda0b2c21963d9200fb7d6c89 akkoma
Matthew Exon said on friendica.exon.name:
@Edent Ha, I was just today making the opposite request 🤣 Admittedly that was only tangentially suggesting that the description should be in the image. I had... other concerns. friendica.exon.name/display/97… Roni Laukkarinen
Denilson says:
That's a bummer. It means
ImageDescription
tag is obsolete, as it doesn't support most of the languages from so many countries around the world.Dan Q said on m.danq.me:
@Edent This post got me thinking about the "thumbnail" images that get embedded in RSS feeds, and how they don't have alt-text. So (among other RSS changes I was making anyway today) I started adding <media:description />s to my blog's RSS feeds!
Thanks for the inspiration. Here's the result: https://danq.me/better-wordpress-rss-feeds Better WordPress RSS Feeds
Jeff Sikes says:
Funny you post this, a revitalized mastodon app is getting this exact feature added. It extracts the metadata caption and inserts it as the suggested alt text (tho you are presented with the value can change it). I never thought about the metadata being uploaded to the server (including location data yikes) so I’m hoping the fediverse is doing the right thing and stripping that data before uploading…
@edent says:
It almost certainly doesn't strip before uploading. But it will probably strip before storing and displaying. That's how most services do it.
nemo said on tatooine.club:
@Edent IPTC also announced two specific tags for accessibility descriptions instead of the the generic caption, which might not always prioritise accessibility concerns. You can see a nice example at https://www.publishersweekly.com/pw/by-topic/digital/content-and-e-books/article/87947-how-publishers-can-get-alt-text-right.html, on where these differences matter.
https://www.scribelytribe.com/post/one-giant-leap-for-accessibility-meet-the-new-photo-metadata-standards How Publishers Can Get Alt Text Right
More comments on Mastodon.