Skip to main content

Generate alternative texts for images.

Project description

interaktiv.alttextgenerator

interaktiv.alttextgenerator CI

Generate alternative texts for images.

This add-on helps editors provide meaningful alt texts for images using AI, improving both accessibility and SEO. By ensuring that all images have descriptive alternative texts, the website becomes more usable for people using assistive technologies and more discoverable by search engines.

Prerequisites

Tested for Plone 6.0.15.

This add-on requires interaktiv.aiclient for its AI capabilities and interaktiv.alttexts to provide the alt text behaviour.

Currently, this add-on only works out of the box with Volto. Therefore, you should also install the according Volto plugin volto-interaktiv-alttextgenerator.

Features

Screenshot of the Alt Text Generator controlpanel

In the controlpanel, you may configure the

  • system prompt
  • user prompt
  • allowed image types
  • blacklisted paths

Remember to configure the AI client inside its own controlpanel as well, since otherwise the generation won't work. Once you configured everything, you're all set.

To verify that the add-on works as intended, upload an image either from the toolbar directly or inside an image block. Toasts visually support uploads from image blocks, whereas uploads from the toolbar are silent.

The generated alt text can look like this:

Sample Image Image by Drosera74 via Pixabay

Iridescent blue and green hummingbird hovering with outstretched wings as it feeds from a bright purple flower against a soft green leafy background. (OpenAI: GPT-5.1, 2025-12-15)

The alt text is generated by AI and includes the model used and the generation date at the end. This metadata is appended only for AI-generated alt texts, which can be identified via the corresponding checkbox in the image’s schema. If the alt text is manually edited, the checkbox is automatically disabled to indicate that the alt text is no longer AI-generated.

Language

All alt texts are generated in the site's language. This behaviour is specified in the default user prompt. If you specify {language} inside your user prompt, it will be replaced with the site language internally. If you wish to use a specific language for the alt texts, you can leave out {language} and specify your own language directly inside the user prompt.

Blacklisting paths

To blacklist a path, you can specify a glob pattern. For every request, the image path is matched against the specified patterns. If it matches any pattern, the generation of alternative texts is skipped.

For describing patterns, the term segment must first be defined:

A segment is used to describe a sequence of characters, that follows after a / and is interrupted by a /. Given a URL www.github.com/plone/volto and looking at its path /plone/volto, two such segments can be identified (plone and volto).

Now all patterns can be described precisely:

  • ? - This matches exactly one character inside a segment.
  • * - This matches zero or more characters inside a segment.
  • ** - This matches one or more segments.

Examples

Pattern Path Matches? Explanation
/images/* /de/images/logo.png * matches any file directly in /images/.
/images/* /de/images/icons/logo.png Only matches a single segment under /images/.
/images/** /de/images/icons/logo.png ** matches files in nested folders.
/media/photo?.jpg /de/media/photo1.jpg ? matches exactly one character in the filename.
/media/photo?.jpg /de/media/photo12.jpg ? matches only a single character.
/private/** /private/user/data/file.png Matches any file under /private/.
** /de/user/profile.png Deactivates generation globally.

Migrate existing images

Chances are, you already have a few images on your Plone site and want to generate alt texts for them as well.

To generate alt texts for existing images without alt texts, you can run the Interaktiv Alt Text Generator: Migration profile from the Zope Management Interface. Beware, this will update every image, so this process may take a while.

Alt Text Generator Migration Profile

The logger will keep you up to date with the current progress of the migration.

INFO    [interaktiv.alttextgenerator:74][waitress-1] Image 1 of 2 queued for migration.
INFO    [httpx:1025][waitress-1] HTTP Request: POST https://openrouter.ai/api/v1/chat/completions "HTTP/1.1 200 OK"
INFO    [interaktiv.alttextgenerator:74][waitress-1] Image 2 of 2 queued for migration.
INFO    [httpx:1025][waitress-1] HTTP Request: POST https://openrouter.ai/api/v1/chat/completions "HTTP/1.1 200 OK"
INFO    [interaktiv.alttextgenerator:90][waitress-1] 2 of 2 images migrated.

Adding this add-on to your project

Install the add-on using pip:

pip install interaktiv.alttextgenerator

or if you're using uv:

uv pip install interaktiv.alttextgenerator

Install from source

You can also install the add-on from the source. In your mx.ini file, add:

[interaktiv.aiclient]
url = git@github.com:interaktivgmbh/interaktiv.alttextgenerator.git
rev = v1.0.0
extras = test

Or using https:

[interaktiv.aiclient]
url = https://github.com/interaktivgmbh/interaktiv.alttextgenerator.git
rev = v1.0.0
extras = test

Contribute

License

The project is licensed under GPLv2.

Credits and acknowledgements 🙏

Generated using Cookieplone (0.9.10) and cookieplone-templates (eae593d) on 2025-11-21 12:25:50.251349. A special thanks to all contributors and supporters!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interaktiv_alttextgenerator-1.0.1.tar.gz (337.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interaktiv_alttextgenerator-1.0.1-py3-none-any.whl (41.5 kB view details)

Uploaded Python 3

File details

Details for the file interaktiv_alttextgenerator-1.0.1.tar.gz.

File metadata

  • Download URL: interaktiv_alttextgenerator-1.0.1.tar.gz
  • Upload date:
  • Size: 337.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.2 cpython/3.12.3 HTTPX/0.28.1

File hashes

Hashes for interaktiv_alttextgenerator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7b20a6446ede7159f45e180685d80ac4e7f59c911e52ce7a1c75b45a89e36f3a
MD5 5a411e384fda38ea8159bf02f977737c
BLAKE2b-256 447a322bdc0ad31e8f0cd2c1408dafb30fa83657d327306f6391f3264d813884

See more details on using hashes here.

File details

Details for the file interaktiv_alttextgenerator-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for interaktiv_alttextgenerator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12bac5a9ac2938c24965ad383536fbe54820f7dcc910072a57d6f53b440d4879
MD5 21bf6dce65e522aa2b61c37aae1c9889
BLAKE2b-256 f361a0fbe774dbc64b3775333b5249c49cee67f2ab4ef2b87e76d5f2e0d0e6d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page