New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 703966 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Images rendering incorrectly in Chrome

Reported by rockona...@gmail.com, Mar 22 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3043.0 Safari/537.36

Example URL:
https://imgur.com/a/N8qbH

Steps to reproduce the problem:
1. View any image, but the problem is especially noticeable on images with dark colors, especially red, brown, purple, and black. Does not always occur, some things render correctly. Things rendered within a web page seem to render correctly more often than direct image links.
2. Download the viewed image or view it in a non-Chrome/Chromium web browser, there will be obvious degradation and rendering errors on Chrome's side.

What is the expected behavior?
The image should render correctly without weird blur and compression? artifacts.

What went wrong?
The image color levels have been wrecked, there's degradation throughout the image, etc. I attached a comparison of the two images; this is porbably obvious, but don't view the comparison within Chromium or the normal image will look the same since it'll be rendered incorrectly in the exact same way.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes unknown, began happening within the past week 

Does this work in other browsers? N/A

Chrome version: 59.0.3043.0  Channel: dev
OS Version: 10.0
Flash Version:
 
Screenshot (118).png
6.5 MB View Download
Screenshot (117).png
5.7 MB View Download

Comment 1 Deleted

Actually, disregard the bit about it being exclusive to PNGs, it just seems inconsistent and erratic. 

These images will display the issue, and are JPGs: https://i.imgur.com/89gmNuu.jpg
https://i.imgur.com/bwBlI5r.jpg
Labels: Needs-Triage-M59 Needs-Bisect
Cc: sureshkumari@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on Windows-10,Windows-7,Mac-10.12.3 and Linux Ubuntu 14.04 using chrome stable version 57.0.2987.110 and canary 	59.0.3047.4 and reported version 59.0.3043.0 with the steps mentioned in comment#0.
Observed same behavior in Firefox too.
Please find the attached screen cast and let us know if anything missed here to reproduce the issue.

Thanks.
703966.mp4
683 KB View Download
Uncertain. I tested the Canary channel (59.0.3047.4) and observed the same messed up image rendering. Chrome 57.0.2987.110 was tried as well, and did *not* have this behavior. 

Maybe it's related to color space? If it's relevant, my computer is an XPS 15 9550 with an 100% Adobe RGB hidpi screen.

Other things I've tried to no avail:
* Resetting all settings to their defaults
* Clean uninstall/reinstall
* Disabling all extensions
* Deleting user profile data manually
* Disabling rendering-related flags in chrome://flags
Project Member

Comment 6 by sheriffbot@chromium.org, Mar 22 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "sureshkumari@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 7 by kochi@chromium.org, Mar 23 2017

Cc: kochi@chromium.org
Components: -Blink Internals>Skia
Status: Untriaged (was: Unconfirmed)
Thanks, I see apparently difference between 2 screenshot PNGs attached,
and Chrome one obviously show some mach bands (non-smooth color gradation).
I'm not sure about JPGs in comment#2, though.

Shotting in the dark to Skia - feel free to reassign appropriate team.
Labels: -Type-Bug -Pri-2 -Needs-Bisect -Needs-Triage-M59 hasbisect-per-revision ReleaseBlock-Stable M-59 Pri-1 Type-Bug-Regression
Owner: ccameron@chromium.org
Status: Assigned (was: Untriaged)
Able to reproduce the issue on Windows-10 using chrome canary 59.0.3048.0.
This is regression issue broken in M59.Please find the bisect information as below
Narrow Bisect::
===============
Good::59.0.3041.0 --   (build revision 456562)
Bad ::59.0.3042.0 --   (build revision 456934)

After executing the per-revision bisect script , i got the following CL's between good and bad build versions
===========================================
https://chromium.googlesource.com/chromium/src/+log/782364b2af9f1c3c7f0a39d5dd9fa1df34cdfb09..24c87c3f418983673089663bb69045451d54f52d

Review-Url: https://codereview.chromium.org/2742613002
ccameron @could you please look into this issue if it is related to your change,else please help us in finding the appropriate owner for this issue.

Note:Issue is specific to Windows-10

Thanks,
kochi, thank you. For the JPGs, the issue with the first (iceberg) picture is especially noticeable in the lower lefthand corner. In the second picture, the issue is very apparent in the shadow of the unicorn floaty's wings.
Cc: msarett@chromium.org
I think I see the issue. In that patch, I change our behavior so that we use the parametric-fit to the ICC profile rather than using the ICC profile directly. It appears that we are not accurate enough.

rockonaile, could you attach the following
- the original image from https://imgur.com/a/N8qbH
- the ICC profile of your monitor

(this is so that I can make sure that our parametric fit is accurate enough)
Actually, just the ICC profile will do -- grabbed the original image.
download.png
8.8 MB View Download
Also, kochi, if you have your ICC profile handy, could you upload it as well?

The difference before and after r456849 is that if we get an accurate parametric representation, then we use SkColorSpace::MakeRGB instead of SkColorSpace::MakeICC.

Accurate here means that the transfer functions are approximated to within 3/256 (which is arguably too leniant around 0/255 and too stringent closer to 255/255, but that can be dealt with later).

In the attached download.png, the input color for some of the hair that is clamped down is RGB (23,27,24)/255. In Screenshot (117), the value I see is (23,0,25)/255. So, something very violent happened to the green channel.

If I can get the user's ICC profile, I should be able to reproduce this locally, and see how we got to be off by 27/255 (nearly 10x the tolerance).
rockonaile: the command to print your ICC profile is
  xprop -display :0.0 -root _ICC_PROFILE
It'll print a really long string. Save that to a file and attach it, and I'll be able to analyze what went wrong.

Comment 14 by kochi@chromium.org, Mar 28 2017

ccameron@ re comment#12, I was just triaging this bug as a sheriff, and
confirmed the difference between the screenshots (see comment#7), and
I haven't been successful to tell the difference locally.
I guess the message was meant for the original reporter rockonaile@, right?
ccameron:
Since I'm on Windows, I wasn't able to run that xprop command, but I found the ICC file my display is using; I hope that will suffice.
CalibratedDisplayProfile-3.icc
9.9 KB Download
Screenshot (121).png
95.4 KB View Download
rockonaile, thank you -- I can reproduce this bug with your profile. I'll make sure it gets fixed ASAP!
Mmh, this is the issue that Matt brought up earlier -- we don't enforce that the approximation be continuous, and, sometimes, the error is minimized by making it discontinuous. The equation for that profile is
  fA 1.041954
  fB -0.050817
  fC 0.108722
  fD 0.141176
  fE 0.018956
  fF 0.000000
  fG 2.149717
And I've attached a graph of the resulting transfer function.

I'll check something in now to fix the image (by just not using the approximation), and then I'll check to see what I can do with the discontinuity.
Screen Shot 2017-03-28 at 1.32.09 PM.png
50.7 KB View Download

Comment 18 by msar...@google.com, Mar 28 2017

Hmm this is a very cool bug...  I haven't done any math, but I'm surprised that the discontinuity caused such noticeable diffs.  I guess maybe the green channel is falling off the ledge and "jumping down"?  Is that your intuition?
I think my approximation code is just getting the wrong answer :/, but only in Chromium.

The python version (attached, with this profile's data) converges almost exactly. Each iteration is 
   (1.000000x + 0.000000)^2.000000 + 0.000000
   (0.913423x + 0.094409)^2.431910 + -0.009481
   (0.958550x + 0.043008)^2.369295 + 0.003108
   (0.956538x + 0.045396)^2.375614 + 0.001741
   (0.956548x + 0.045384)^2.375600 + 0.001743

The C code, meanwhile, on the same data, does
   (1.015030x + -0.024796)^2.207001 + 0.021426
   (1.043929x + -0.053044)^2.143882 + 0.019440
   (1.041836x + -0.050683)^2.149949 + 0.018925
   (1.041958x + -0.050822)^2.149709 + 0.018957
   (1.041954x + -0.050817)^2.149718 + 0.018956

The Python code doesn't bake in the assumption that T(1)=1, and it also does a full QR factorization (as opposed to just creating the 3x3 normal equations), and it uses doubles instead of floats. So... it's one of those three.
Yeah, I somehow botched the T(1)=1 constraint. When I put that into the python code, it screws up in the same way.
fit-transfer-function.py
16.2 KB View Download
Actually ... this data just doesn't fit at 1 -- the best fit doesn't satisfy that constraint -- T(1) for the good fit is 1.00634.

So, maybe we should just let that happen...
So, when we histogrammed T(0) and T(1), many of them were lies. Here's the zoom-in on this transfer function.
trfn_at_one.png
23.7 KB View Download
My two cents is that we should get the best fit that we can, while enforcing that T(1) = 1 and that the fn is continuous.  I believe we're seeing here that discontinuities can cause images to look weird.  And we are always going to have a bit of difficulty with the fit when the monitor profile transfer fn has "corners" - seems like a bad fn to me.

Maybe allowing T(1) to be greater than 1 is ok (if we clamp).  But allowing it be less than 1 seems really strange - we'll never use 255 as the pixel color.  I guess there's no evidence that this looks bad either way - but forcing the end points to be sane makes me a little more comfortable.
Cc: jmukthavaram@chromium.org
Labels: Needs-Feedback
Tested this issue on Windows 10 with chrome dev version-59.0.3061.3 as per the below provided in comment#0.
https://imgur.com/a/N8qbH

Please find the attached screenshot & confirm us on the fix.
Thank you!!
latest canary.png
3.1 MB View Download
I can confirm, the issue seems to be fixed as of ccameron's commit. Thanks @ccameron!
@ccameron!
Could you please confirm us on the fix as per comment#25.
Thanks in advance!!
Labels: TE-Verified-59.0.3061.3 TE-Verified-M59
Please ignore above comment(27). As per comment#26,reporter confirmed that issue has been fixed. Hence adding TE Verified labels.
Thank you!!
Status: fiv (was: Assigned)
Status: Fixed (was: fiv)

Sign in to add a comment