[Webkit-unassigned] [Bug 73952] canvas/philip/tests/2d.imageData.put.unchanged.html expects putImageData/getImageData to exactly preserve unpremul-alpha pixel values

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 7 08:20:52 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=73952





--- Comment #3 from Brian Salomon <bsalomon at google.com>  2011-12-07 08:20:53 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > Actually, I think the test link is referring to this statement:
> > 
> > "The handling of pixel rounding when the specified coordinates do not exactly map to the device coordinate space is not defined by this specification, except that the following must result in no visible changes to the rendering # 2d.imageData.put.unchanged :
> > 
> > context.putImageData(context.getImageData(x, y, w, h), p, q);"
> > 
> > So although the mult/premult changes are lossy, in order to be spec-compliant, I think you have to be value-preserving over one roundtrip.
> 
> My take is that the rounding language refers to rounding coordinates to the pixel grid. The test seems to be exercising this by doing its get/put at coordinate (.1, .2) rather than (0, 0). Also it says "no visible change" not no change at all. The later language about premultiplying seems to indicate that a roundtrip may come back as "different values."

Take a look at the entire paragraph that the sentence beginning with "The handling..." is part of:

<quote>
The handling of pixel rounding when the specified coordinates do not exactly map to the device coordinate space is not defined by this specification, except that the following must result in no visible changes to the rendering # 2d.imageData.put.unchanged :

context.putImageData(context.getImageData(x, y, w, h), p, q);
...for any value of x, y, w, and h and where p is the smaller of x and the sum of x and w, and q is the smaller of y and the sum of y and h; and except that the following two calls:

context.createImageData(w, h);
context.getImageData(0, 0, w, h);
...must return ImageData objects with the same dimensions, for any value of w and h # 2d.imageData.create2.round . In other words, while user agents may round the arguments of these methods so that they map to device pixel boundaries, any rounding performed must be performed consistently for all of the createImageData(), getImageData() and putImageData() operations.
</quote>

The thrust seems to be that get, put, and create must all consistently round points and dimensions to device coordinates. Then it says:

<quote>
Note: Due to the lossy nature of converting to and from premultiplied alpha color values, pixels that have just been set using putImageData() might be returned to an equivalent getImageData() as different values.
</quote>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list