By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Automation of ALT Text Generation for Images Using the OpenAI API | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > Automation of ALT Text Generation for Images Using the OpenAI API | HackerNoon
Computing

Automation of ALT Text Generation for Images Using the OpenAI API | HackerNoon

News Room
Last updated: 2025/09/10 at 8:18 AM
News Room Published 10 September 2025
Share
SHARE

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.

Example of a Generated alt for an Image

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

OpenAI API Usage Metrics

Some Numbers:

  • 46.82s execution time for 5 requests to the OpenAI API with p-limit 1;
  • 19.71s - 23.12sExecution 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).

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Absolutely everything you need to know about the iPhone 17 Pro
Next Article Today's NYT Connections Hints, Answers for Sept. 10, #822
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Amazon’s Zoox launches its robotaxi service in Las Vegas
News
FORTERRO BUY THE SPANISH COMPANY OF INNOLOGY BUSINESS MANAGEMENT SOFTWARE
Mobile
A new round of Apple Watches have arrived. Here’s where to preorder.
News
SpaceX Targets an Orbital Starship Flight with a Next-Gen Vehicle in 2026
Gadget

You Might also Like

Computing

Zink Begins Optimizing For Workstation Graphics With SPECViewPerf: Doubles The Perf

1 Min Read
Computing

China’s Geely steps up restructuring with new intelligent driving brand · TechNode

1 Min Read
Computing

The iPhone Air looks great, but the compromises are hard to ignore

8 Min Read
Computing

Cost of smartphones keep six in ten Nigerians offline

7 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?