Page MenuHomePhabricator

Images with dark content and transparent background appear unreadable in Dark Mode
Closed, ResolvedPublicBUG REPORT

Description

Example:

What happens?:

  • A logo in Black is rendered invisible

What should have happened instead?:
Some contrast to see logo

Software version
2.750416-r-2022-07-27 Android

Other information (browser name/version, screenshots, etc.):

Screenshot_20220727-114924.png (2×1 px, 322 KB)

Event Timeline

JTannerWMF renamed this task from [placeholder] Bug for pictures in article in Dark Mode to Bug for pictures in article in Dark Mode .Aug 8 2022, 2:59 PM
JTannerWMF updated the task description. (Show Details)
JTannerWMF subscribed.
LGoto triaged this task as Low priority.Aug 8 2022, 4:34 PM
LGoto moved this task from Needs Triage to Tracking on the Wikipedia-Android-App-Backlog board.

@LGoto, @JTannerWMF this doesn't look like a bug per se, as the logo is a transparent PNG. The issue would also happen if we were in light mode and the logo happened to have white text on a transparent background. Is there a chance we can reach out to the community and have them add an actual background to the image?

Is there a chance we can reach out to the community and have them add an actual background to the image?

But this would make a white picture show instead, which is not very nice too. Besides I think transparent background was always kinda preferable for certain kinds of images.

Is it possible to somehow detect when this would happen for an image and add some generic light background?

Dbrant renamed this task from Bug for pictures in article in Dark Mode to Images with dark content and transparent background appear unreadable in Dark Mode .Dec 12 2022, 3:26 PM
Dbrant updated the task description. (Show Details)
Dbrant added a subscriber: jhsoby.
Aklapper changed the subtype of this task from "Task" to "Bug Report".Feb 17 2023, 8:22 AM

I feel it bears mentioning that with SVGs, a solution to this is potentially trivial: at least with fills and strokes that are set to currentColor (and possibly also those that are left unset or set to #000) it would fix the vast majority of issues to simply display those SVG elements as white instead.

The app would respect "skin-invert-image" at some point I guess?

Jdlrobson added subscribers: Dbrant, Jdlrobson.

@Dbrant this is working on web. Is it also fixed in the app now or does the app need to add support for skin-invert-image?

A VRT customer reported this similar issue with a SVG image (File:Tianeptine2DACS.svg)

See on-page here: https://en.wikipedia.org/wiki/Tianeptine?vectornightmode=1&safemode=1&useskin=vector-2022

Hey @Xaosflux this is for apps - we are evaluating a possible generic solution in T370074 given the amount of feedback about this isuse we're seeing on https://www.mediawiki.org/wiki/Reading/Web/Accessibility_for_reading/Reporting

ABorbaWMF subscribed.

Looks good on 2.7.50543-r-2025-07-31

Tested on Pixel 6 on Android 15 and OnePlus 8 on Android 13. Tested on article with dark images with transparent backgrounds.

ABorbaWMF added a subscriber: ARamadan-WMF.

Reopening this one based on some user feedback highlighted by @ARamadan-WMF.

Testing on iOS 7.8.5 (5873) and 2.7.50554-alpha-2025-11-03

  1. On dark themes
  2. Navigate to this article: Animal Feed
  3. Scroll to the Major Ingredients section
  4. View the image under Chelates

Note: On both apps, the image looks fine in light themes

Android

Screenshot_20251110-121153.png (2×1 px, 268 KB)

Screenshot_20251110-121145.png (2×1 px, 208 KB)

Screenshot_20251110-121201.png (2×1 px, 103 KB)

iOS

IMG_7086.jpg (2×1 px, 286 KB)

Quick reminder @ABorbaWMF @ARamadan-WMF
For dark mode issues that appear specific to an individual article, it is very likely to be resolved by making an edit to the article itself.
Observe that the image you highlighted above also looks incorrect in mobile web:

Screenshot_20251110-162337.png (2×1 px, 435 KB)

...meaning that the article (or any transcluded templates) itself should be edited to be more compatible with dark mode (on web and apps). The likely solution is to add a skin-invert-image class to the image.

With all due respect, article editors should not have the burden of making the content compatible with light/dark mode. The underlying system/app should be the one responsible of this.

With all due respect, article editors should not have the burden of making the content compatible with light/dark mode. The underlying system/app should be the one responsible of this.

Of course, and we're trying to reduce the burden as much as possible; In most cases the dark mode logic is indeed handled automatically. But unfortunately there will be a small number of edge cases where a CSS class must be added manually.
In the specific case of inverting the colors of certain images, our logic simply has no way of knowing whether an image should be inverted or not, therefore it requires a "hint" by the editor, in the form of the skin-invert-image class.

(See also our full list of recommendations for keeping articles streamlined for compatibility)