In many answers I've read here, there are conflicting opinions on the niche cases when alt text should or should not be added to an image. So what are the situations in which is is better not to add alt text to an image?
Here are a few situations I can think of when it might not necessarily be a good idea to add alt text (but these are just examples):
- When the image is abstract (doesn't represent anything meaningful in particular)
- When the author of the page doesn't have time to write good alt text (so any alt text they write will be poor)
- When the image is just an universal icon (e.g. a magnifying glass icon next to a "search" label)
- When the image only loosely represents a feeling / mood rather than representing the content it is above / next to (so that it might visually be connected to the content but the connection is confusing when written / read aloud)
- When the image is purely for style (e.g. decorative borders)
These are some of the scenarios we've discovered in my team at a university publishing scientific literature for the general public.
Perhaps alt text should be added in every one of these cases; or maybe the answer is "it depends" in each case. And if it depends, then on what does it depend?
alt=""
then their screenreader will just read out 'Image'. They have no way to know its a decorative image, an abstract one or that the author 'didn't have time to write it'. They just get told there's an image at that point in the text but with absolutely no context as to what that is. That's a poor experience and breaches accessibility guidelines (so you'll fail any audits your site goes through).