Tools & Facts

Generate Alt Text of Images Using Artificial Intelligence

Apple, Amazon, Tesla - these are just a few of the global brands that benefit from the use of artificial intelligence and cognitive technology. Your business can go in their footsteps by taking advantage of AI-generated image alt text on your website.

How to generate image alt text

Microsoft's Cognitive Services caption a picture of Elon Musk in front of a red Tesla as "Elon Musk standing in front of a red car".
A picture of Elon Musk analysed in the Azure Computer Vision API.

You can analyse an image by going to the Image Processing with Computer Vision API site. The tool provides an abundance of information. From accent colour, dominant background and foreground colours, through facial recognition, all the way to a list of tags, suggested caption and identifying adult and “racy” content.

The AI-generated caption for the above image is “Elon Musk standing in front of a red car.” Not only does the tool identify it’s Elon Musk, but it also estimates his age – and isn’t very far off. The picture was taken around 2014 when Elon was 42.

And while you might be fine doing the same for a few images, it defeats the purpose. As with almost everything, there’s a WordPress plugin to help you.

Generate image alt text in WordPress

Automatic Alternative Text uses Microsoft’s Cognitive Services Computer Vision API to generate image alt text for pictures uploaded when the plugin is active.

Automatic Alternative Text WordPress plugin captions a picture of a lying lion as "a lion lying in the grass".
Automatic Alternative Text plugin in action.

Setting up the plugin is easy but requires an API key which you can acquire from Microsoft for free (with the “price subject to change” caveat). There’s a detailed installation guide on the plugin’s page.

Another step towards website accessibility

We have highlighted the importance of alternative text in a recent article about website accessibility and now you can make your website accessible for everyone with the use of artificial intelligence.

It’s important to not get too comfortable having the help of AI. You should develop a habit of crafting accessible content and writing alternative text for images should be a part of that exercise.

We recommend briefly revising the AI-generated alternative text before you use it. Pictures with little detail usually get spot-on descriptions, but in our example, the cognitive service doesn’t recognise that Elon Musk is charging the car or that the car is a Tesla. Depending on the context, this may or may not matter.

In the end, it’s all for your visitors. Improve their experience by making your website accessible and reap the rewards.

PS In case you were wondering, the Elon Musk photo was identified as neither adult content nor a racy picture. Sorry Elon, you’re only 1.5% racy.

The adult content and racy scores for the picture of Elon Musk were 1%.
Elon Musk isn’t racy.

Originally published Feb 07, 2019 9:54:25 AM, updated November 25 2020.

Google rating Navigation line
Menu Scroll button