Skip to content

Alt text generation must describe the purpose and function of the image rather than the image content. #350

@afercia

Description

@afercia

Description

In the current alt text generation instructions i read:

- Be descriptive: Describe what is visually present in the image
- Be objective: Describe what you see, not interpretations or assumptions

That's not correct and it's one of the most common misconception of what the alt text is supposed to be.

I do realize that, so far, this plugin is an experimental plugin meant to show off the Ai abilities features.
However, this sets a precedent that points to a lett-than-ideal practice that could propagate and be replicated i other implementations. It needs to be fixed. Even experiments or demos should use best practices.

The instructions clearly instruct the AI agent to describe the content of the image.
That's only one case. There are many, many cases where the actual purpose and function of an image are not its content. To name a few examples:

  • An image that is the only content of a link.
  • An image that is within a link that already contains other text.
  • An image that is within a button.
  • All the other cases described in the W3C Alt decision tree.

In may of these cases, an alt text that describes the image content would be just wrong and would provide a wrong information when:

  • The image is broken and the alt text is visible for all users.
  • Screen reader users.
  • SEO.
  • Other machines reading the page content.
  • More potential cases.

The instructions should actually replicate the W3C Alt decision tree steps so that they provide correct context for the AI agent.
After that, the instructions should be carefully reviewed by accessibility specialists and integrated with more steps if needed.
It may be necessary to pass the surrounding markup or parse it before the request to the agent to determine whether the image is within a link or button or other cases where it is a functional image.

As it is now, the implementation is less than ideal and contributes to spread less than ideal practices arount the internet.

Step-by-step reproduction instructions

Describing just one example where the current implementation fails:

  • Add an Image block with an image of an airplane taking off. I used an image of an Airbus 330.

Image

  • Add a link to the image that points to the JFK airport website.
  • Use the ability to generate the image alt text.
  • Actual generated alt text: White Airbus A330 airplane taking off against a blue sky.
  • It accurately describes the image content. Unfortunately, that alt text is totally wrong.
  • Expected: Go to the JFK airport website or something along those lines.

It is worth noting that if the link already contained text that described the link purpose / destination, the image would had need an empty alt tag alt="". As mentioned earlier, there are many cases to follow and logic steps to take that it's impossible to describe all of them in a single issue.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except the AI plugin.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Type] BugSomething isn't working

Type

No fields configured for Bug.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions