9

Stack Exchange allows users that add an image to a post to enter an alt text. When uploading an image the following markdown is inserted:

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/some-id.png

Recently the alt text feature has become more prominent with the following pop-up message below the editor when you add an image but do not modify the template text:

Image Alt Text
Images should have specific alt text briefly explaining what is shown. Use the square brackets immediately following the '!' for this (which may currently contain 'enter image description here').

In my answers I always add a screenshot of the result at the end. Almost all of my answers follow the following structure:

Text discussing the issue and the proposed solution, often with inline code or with one or more

small code blocks

MWE:

full code of mwe

Result:
🖼️ (image with screenshot of result)

occasionally some closing remarks after the screenshot

I never added an alt text before. Since the pop-up message was implemented I do change the alt text into screenshot of result because that seems like a valid description of the image.

I do wonder however if this conforms to best practises. I have the following questions:

  1. Is the alt text screenshot of result sufficiently specific? If not, then what should it be instead?
  2. What about the situation where two different options are presented in an answer, each with their own screenshot of the result?
  3. The WCAG defines some exceptions to the need for alternative text, that seem to be based on a consideration if the alt text is helpful for reading the page if the user is visually impaired. A screenshot does not provide any added value if a user is visually impaired, and an alternative text cannot convey the intention of "you can see here that the output addresses the issue that the question asked about". Therefore it seems superfluous to add an essentially empty placeholder text. Of course it is informative for a visually impaired user to know that the image can safely be skipped, but given the context of the answer this is probably already sufficiently clear. Does it still serve a purpose to add an alternative text for screenshots like this?
5
  • 2
    Good question. I've generally entered something like "output of example code", simply because the option was offered, but I've never actually noticed how that was presented in an answer. But It may mean less in the tex.sx forum than in others, since the reason to insert a visual is usually pretty obvious. Commented Aug 4 at 13:20
  • A related thought: if we somehow get to the point where we can automatically add better alt text to images, then will searching for the alt text "enter image description here" be easier than searching for the vague "code output" that Marijn, barbara beeton, myself, and presumably many other have used?
    – Teepeemm
    Commented Aug 4 at 16:13
  • @Teepeemm It would be nice to have some automatic assistance - at least as a starting point the user can then modify. It would certainly be a better use of technology than the user who semi-automatically edits the alt texts of images like this: i.sstatic.net/PiQvO.png Commented Aug 4 at 17:15
  • 1
    Usually these alt texts are for screen readers that describe the image which is not just “output of code above”. First search result says: “Alt text should not just describe what the image contains, but instead should provide context on how the image relates to the page content.” I guess the relation is clear. But it should really describe what is pictured: A table? A diagram? An equation? A full page's layout? I guess it should also highlight what specific part in the picture relates to the answer. Table header? Tick label? … Commented Aug 4 at 20:35
  • But for this site, the vast majority of images are compiling the code that was just presented to show that it does solve the question of that page. In which case, the context of how the image relates to the page content is "this image shows that my code solves the question in the way that I claim that it does in the rest of my (textual) answer". Which I feel is about as vaguely unhelpful as "code output".
    – Teepeemm
    Commented Aug 5 at 14:39

0

You must log in to answer this question.

Browse other questions tagged .