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.
https://akkoma.dev/AkkomaGang/akkoma/commit/c06a5af386a3cdfeda0b2c21963d9200fb7d6c89 akkoma
ImageDescription
tag is obsolete, as it doesn't support most of the languages from so many countries around the world.@edent says:
@Edent @simevidas I certainly agree that a default image description shouldn't be used automatically without prompting the content author to review / edit it. But there are also lots of times when it would be good enough, or a good start.
From that perspective, there is a difference between passing the metadata silently inside the image file and passing it as a complex data object that can be used to pre-populate an alt text field.
More comments on Mastodon.