Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha for PNGs in between (0%..100%) results in funny looking color in CPU rendering only #2857

Closed
LalehB opened this issue Jul 16, 2014 · 3 comments

Comments

@LalehB
Copy link
Contributor

@LalehB LalehB commented Jul 16, 2014

There is a difference in the pictures that we get when we render with CPU or GPU, it looks that images with CPU does not have the same quality of GPU rendering.
Here is an example:

For CPU rendering with this command:

./servo -c  http://en.wikipedia.org/wiki/Nexus_5

The result is:
A Wikipedia page with CPU rendering

And for GPU rendering with this command:

./servo  http://en.wikipedia.org/wiki/Nexus_5

The result is:
A Wikipedia page with GPU rendering

As you can see there is a difference in these two pictures. (picture for CPU rendering is not as good as GPU rendering)

@zwarich zwarich self-assigned this Jul 16, 2014
@zwarich
Copy link

@zwarich zwarich commented Jul 16, 2014

This looks like a problem with the handling of the alpha channel. I'll take a look.

@glennw glennw mentioned this issue Jul 16, 2014
42 of 56 tasks complete
@LalehB LalehB changed the title Different image resolution on GPU and CPU rendering! Different image resolution on GPU and CPU rendering Jul 16, 2014
@pcwalton pcwalton changed the title Different image resolution on GPU and CPU rendering Alpha for PNGs in between (0%..100%) results in funny looking color in CPU rendering only Sep 10, 2014
@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Sep 10, 2014

Even in the GPU rendering case the rendering is not quite correct -- it looks like semitransparent pixels are rendered as white.

In a simple test case with just an <img> element and nothing else, I get correct results if the body has background: transparent, but incorrect results if it has a solid background.

@pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Sep 10, 2014

This is because we don't premultiply. PR coming.

pcwalton added a commit to pcwalton/servo that referenced this issue Sep 11, 2014
pcwalton added a commit to pcwalton/servo that referenced this issue Sep 11, 2014
pcwalton added a commit to pcwalton/servo that referenced this issue Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.