New issue
Advanced search Search tips

Issue 882264 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Improper gamma correction for text on Linux

Reported by bmil...@gmail.com, Sep 9

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Go to any dark background website (steam, netflix) or here https://bel.fi/alankila/lcd/ 
2. See how text is "washed out" due to improper blending.

What is the expected behavior?
Text is consistent and readable, as it is for Chromium in Windows, Mac and Android. Firefox on Linux share the same problem (as it uses the same skia/BUILD.gn definitions)

What went wrong?
Some text looks washed out, not readable, blurry.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 69.0.3497.81  Channel: stable
OS Version: Manjaro
Flash Version: 

This is an old issue but its time to review/tweak skia/BUILD.gn - specifically this:
# Settings for text blitting, chosen to approximate the system browser.
  if (is_linux) {
    defines += [
      "SK_GAMMA_EXPONENT=1.2",
      "SK_GAMMA_CONTRAST=0.2",
    ]
  } else if (is_android) {
    defines += [
      "SK_GAMMA_APPLY_TO_A8",
      "SK_GAMMA_EXPONENT=1.4",
      "SK_GAMMA_CONTRAST=0.0",
    ]
  } else if (is_win) {
    defines += [
      "SK_GAMMA_SRGB",
      "SK_GAMMA_CONTRAST=0.5",
    ]
  } else if (is_mac) {
    defines += [
      "SK_GAMMA_SRGB",
      "SK_GAMMA_CONTRAST=0.0",
    ]
  }

I know that will depend on a lot of other factors (dpi, fonts used, hinting type, lcd rendering type etc) but I tested a few combinations of settings and settled my personal build to use the same Windows settings plus SK_GAMMA_APPLY_TO_A8 to also apply the correction during certain text animations and improve consistency (without it text would flicker between non-corrected and corrected gamma in a inconsistent manner). It looks great for me but I understand there are more capable people to decide what is right. Freetype devs for instance like a 1.8 value, this guy https://bel.fi/alankila/lcd/ is more aggressive and goes for 2.2 which may thin out dark-on-light text a bit too much.
 

Comment 1 Deleted

Here's two samples from my build using those settings:

  if (is_linux) {
    defines += [
      "SK_GAMMA_SRGB", // not sure if this is SK_GAMMA_EXPONENT=2.2, but looks like it is from my tests. couldnt find a reference anywhere
      "SK_GAMMA_APPLY_TO_A8",
      "SK_GAMMA_CONTRAST=0.5",
    ]

Left is Chromium default (actually chrome-dev 70.0.3538.9, so I can run both easily)
Right is modified Chromium (from chromium stable 69.0.3497.81)
Screenshot_20180909_173832.png
467 KB View Download
Screenshot_20180909_173847.png
494 KB View Download
Labels: Needs-Triage-M69
Components: -Blink Internals>Skia
It seems both chromium and firefox entered a vicious cycle of copying each other settings. Just had an idea after reading some old discussions on this matter: some people will complain their rendering is too different, so get the best of both worlds exposing gamma tweaking to runtime flags instead of hardcoded definitions. 
Cc: phanindra.mandapaka@chromium.org
Labels: Triaged-ET Target-71 M-71 FoundIn-71 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on reported chrome version 69.0.3497.81 also on latest chrome 71.0.3555.0 using Mac 10.13.6, Ubuntu 14.04 and Windows 10.  
 
Same behavior is seen on M60(60.0.3112.113) hence considering it as non-regression and marking it as Untriaged.

NOTE: Blurry font seen on pink border.

Thanks! 
After days of testing on 3 different LCD monitors 1.8 gamma is the way to go. It also fix some unequal glyphs and makes LCD color fringes less noticeable, with the disavantage of thinning black text. I am also not sure Chromium is handling freetype2 new LCD harmony mode correctly, still investigating before I file a bug.
I would try to take these points in consideration to improve text in linux in general: https://www.freetype.org/freetype2/docs/text-rendering-general.html
Freetype changed a lot since 2012 :)
any updates on this?

Sign in to add a comment