When a project card's cover image has no hand-written alt text, a screen reader only says "screenshot of X", and a screen reader user cannot tell what is in the picture. There are over a dozen project images and writing each by hand is tedious, so I had gemma3:12b (which has vision) on my desktop write a first draft: feed each image in and ask for one sentence describing "what is actually visible".
Don't use it as it comes out
I checked every sentence against its original image, and there were more mistakes than I expected:
- The home page of this site has a light background; the model wrote "white text on a black background".
- For the Orange data-mining workflow screenshot, it wrote "a diagram of a machine-learning workflow including data preprocessing, model training and evaluation". That sounds plausible, but none of what is really in the image (loading aqi_data.csv, five classifiers, the confusion matrix and ROC) was mentioned.
- A currency exchange page with a dark interface came back as an empty string. The script reported no error; there was just an empty value in the JSON.
The first time, I even aimed at the wrong target: I ran the first pass over the small images under icons/, then realized those are decorative images beside the cards, whose alt should be empty in the first place. The images that actually need alt text are the big ones at the top of each card.
What I ended up doing
The model only writes the draft. I rewrote each one by hand into facts that are visible in the image and saved them as image-alt.json. The code reads that file only when there is no hand-written imageAlt. This has two advantages: the build does not depend on Ollama, and fixing a mistake means editing one JSON file.
Vision models are very good at writing sentences that sound right. Alt text is for people who cannot see the image, so getting it wrong is worse than leaving it out.