Hello, I’m a developer who has been building websites for some time. Not long ago, I took part in the development of a website that is still in its early stages. This is my test project for checking my own features (my first commercial project where I also worked on the server-side of the website; before that, I had experience creating a small REST API using Express.js, but here the server was built with Nest.js).
I won’t go into too many details now – instead, in this article I’ll write about the benefits I personally gained from this experience. (It might be within the next few days or weeks, I’ll either highlight a quote in this blog or leave a link in the comments here.)
Introduction to the Core of the Problem
One of the main and key problems is the lack of a unique h1 on image pages (many website SEO checking services report non-unique errors as a critical or medium-level issue), which is indexed by GoogleBot and participates in search results and Google Images.
The problem was the absence of alt in images, which are needed to improve SEO and adjust settings in Google Images, including to improve the accessibility of your website (see the European Directive on the accessibility of digital products and services, effective June 28, 2025):
- problems when including an image;
- for people with visual impairments, screen readers read the alt;
- content cannibalization, for example, in the title and alternative images, leads to the use of titles to which the image belongs; in the web project, there were a large number of such titles.
An Example of This Problem Was Solved
The old version of the title and alternative text that was used looked like this, for example with this image – FlatOut 2 Screenshot 48. Below is the current version, which was generated with AI.
PS: The image description and caption were also generated with AI, but later we abandoned this idea since we cannot fully create the description – it turns out too long. (You can see an example here, and you can also compare this description – these were our first attempts based on the game description with the addition of the page. We eventually concluded that it was useless, but we decided to leave it in these test cases.)
Problem Solution
At the moment, I’ve written a test version – a small service that uses the OpenAI API and a function that provides prompts for AI templates of input data and configuration settings. (By the way, the new GPT-5 version no longer has the temperature parameter; previously, this parameter influenced creativity – see more details).
The next step in the development was a function in the image service, which is responsible for retrieving images that don’t yet have an alt or title. This function worked with a limit on the number of images to avoid overload. The p-limit library was used to manage parallel requests to the OpenAI API and speed up data generation.
So, we now have a ready function that can generate textual descriptions for images.
Currently, I use a cron function to trigger this process at intervals. In other words, I don’t generate alt text immediately at the time of image upload and don’t execute this operation in a separate queue (like Bull, BullMQ, and others).
At the moment, I am using the version gpt-4_1-mini-2025-04-14
Some Numbers:
46.82s
execution time for 5 requests to the OpenAI API with p-limit 1;19.71s - 23.12s
Execution time for 5 requests using a p-limit of 3;
These numbers correspond to the version in use gpt-4_1-mini-2025-04-14
The price of this version is quite low: when generating alt text and titles for around 2,200 images, the cost was $5.5. I also tested more expensive versions but did not notice any significant improvement in the quality of generation or the accuracy of the image descriptions.
What We Achieved in the End
- Unique page title;
- Fully filled-in alt text;
- Reduced cannibalization in the project;
- Reduced workload for content authors (a concrete example: a website created in 6 languages, where authors cannot always afford to add alt/title to images in all languages – and in most cases, they don’t even want to do it in one language);
- More attractive and enriched snippets in search results;
- OpenGraph metadata, which can attract users from social networks.
In conclusion, I can say that the idea came naturally, although it is far from new.
Today, you can already find many ready-made solutions in search. If anyone needs help with such a custom implementation, here is my GitHub.
Sources:
- European Directive on the accessibility of digital products and services;
- Example website;
- p-limit – a library for controlling concurrency of Promises;
- Cheat sheet on the
temperature
[ and ]()top_p
[ parameters in the ChatGPT API](); - GitHub (for contact).