One possible solution to make the image viewable would be to invert the colors when a transparent background is detected and inverted mode is enabled. I suspect this isn't a general solution, but it is good enough. It may have unintended consequences too, so I think it should be opt in on a per site basis.
Consider the following site for example: https://www.boost.org/doc/libs/1_60_0/libs/graph/doc/adjacency_list.html
Before:
After:
One possible solution to make the image viewable would be to invert the colors when a transparent background is detected and inverted mode is enabled. I suspect this isn't a general solution, but it is good enough. It may have unintended consequences too, so I think it should be opt in on a per site basis.