The module uses the Microsoft Azure Cognitive Services API or Alttext.ai to
generate an Alternative Text for images when no Alternative Text has been
provided by user.

About the API:

Computer Vision API - v1.0

The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively.

Describe Image

This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All descriptions are in English.

Here is a real world example, no demo content:

a rainbow in the sky

By a confidence level of 76.75%, the API describes the image as: "a rainbow in the sky"

Use

After the module has been installed hook_entity_presave() is used to check if the entity being saved contains an image field with no ALT-Text specified. If this is the case the image is send to Cognitive Services API and an ALT-Text will be generated automatically.

Translation

Introduced with 8.x-1.1 it is now possible to translate the image description to other languages than english.

Suggestions

Introduced with 8.x-1.4 it is now possible to get suggestion for the Alternative text on image upload. The suggestion will only be made, if the Alternative text field is enabled for the image field used.

Version 2.x

The new version supports Drupal 10 and the key module to store the API keys with higher security.

Key provides the ability to improve Drupal security by managing sensitive keys (such as API and encryption keys). It gives site administrators the ability to define how and where keys are stored, which allows the option of a high level of security and allows sites to meet regulatory or compliance requirements.

Thoughts about usage

If you run a website, where editors insert the content, you can force them to specify an Alternative text by simply making the field required. You can train the editors on best practices, how to add the correct Alternative text to the image, depending on the context the image is shown.
This is something you can’t achieve with this module.
But for sites like Communities, Portals, Intranets - all sites with user generated content - forcing the users to specify an Alternative text would lead through less engagement. The users may even not be aware of the purpose and importance of the Alternative text.
The Cognitive Service does no face recognition and describes the content of the image in one sentence – no matter in which context the image is shown on the site. The use of this description as Alternative text will deliver the best accessibility you can offer for your site to Screen readers, or Persons with Disabilities in this case.

More ...

Automatic Image Moderation checks images against racist and adult content.

Supporting organizations: 
Sponsorship
AttachmentSize
auto_alter.jpg106.24 KB

Project information

Releases