Skip to content

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

Closed

Description

@LalehB

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)

Activity

  1. self-assigned this
    on Jul 16, 2014
  2. zwarich commented on Jul 16, 2014

    @zwarich

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

  3. changed the title [-]Different image resolution on GPU and CPU rendering![/-] [+]Different image resolution on GPU and CPU rendering[/+] on Jul 16, 2014
  4. 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[/+] on Sep 10, 2014
  5. mbrubeck commented on Sep 10, 2014

    @mbrubeck
    Contributor

    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.

  6. pcwalton commented on Sep 10, 2014

    @pcwalton
    Contributor

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

  7. added 3 commits that reference this issue on Sep 11, 2014
    629109b
    dc5c800
    a3465d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions