Skip to content

Add alt_text option to save_plot_as_png - #115

Closed
ruaridhg wants to merge 1 commit into
mainfrom
110-add-alt-text
Closed

Add alt_text option to save_plot_as_png#115
ruaridhg wants to merge 1 commit into
mainfrom
110-add-alt-text

Conversation

@ruaridhg

@ruaridhg ruaridhg commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

Checked with exiftool -PNG:Alt <image_name.png>

@ruaridhg ruaridhg linked an issue Sep 4, 2025 that may be closed by this pull request
@ruaridhg
ruaridhg marked this pull request as ready for review September 5, 2025 14:02
@ruaridhg
ruaridhg requested a review from dstansby September 5, 2025 14:02
@dstansby

Copy link
Copy Markdown
Contributor

Nice! If alt-text is added to the .png metadata file this way, and the .png file is added to a web page (ie, https://heftieproject.github.io/zarr-benchmarks/), does web browser "know" this is where to find the alt-text, and display it when moused over (or say it when a screen reader is being used)? I assumed that we might have to manually add the alt-text to the markdown file, but if we can semi-automate it like this that would be a bit easier.

@dstansby

Copy link
Copy Markdown
Contributor

Following on from our meeting, out of interest where did you get inspiration for this implementation from? I'm intrigued if adding alt-text to .png files in this way is some sort of standard.

@ruaridhg

Copy link
Copy Markdown
Contributor Author

Following on from our meeting, out of interest where did you get inspiration for this implementation from? I'm intrigued if adding alt-text to .png files in this way is some sort of standard.

https://stackoverflow.com/questions/58399070/how-do-i-save-custom-information-to-a-png-image-file-in-python
It may just be if you're using Pillow so probably not standard. I added alt-text to the main PR #79 instead of using this method.

@dstansby

Copy link
Copy Markdown
Contributor

Should we close this in favour of your changes in the other PR then?

@dstansby

dstansby commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

We decided this isn't needed, and instead alt-text will be added manually to the markdown files.

@dstansby dstansby closed this Oct 9, 2025
@dstansby
dstansby deleted the 110-add-alt-text branch October 28, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alt text to images in write up

2 participants