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:

Screenshot showing technical details of the metadata on a photo. It contains a copyright notice.

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.

An AI generate image based on the text "Woman, celebrity, red dress, smiling, evil eyes, holding a knife, red carpet, arm tattoo."

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.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

7 thoughts on “Should you embed alt text inside image metadata?”

  1. says:

    Two-byte character codes cannot be used.

    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.

    Reply
  2. 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…

    Reply
    1. @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.

      Reply
  3. 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

    Reply | Reply to original comment on tatooine.club

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">