Closed Bug 322647 Opened 19 years ago Closed 18 years ago

drawImage from canvas darkens image

Categories

(Core :: Graphics: Canvas2D, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: bugzilla, Assigned: roc)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

When using a canvas as the source for drawImage, the lightness seems to be very slighly decreased in the resulting image.

This happens regardless whether the source is another canvas or the target itself. Doing clearRect on the target before drawing does not help. 
globalAlpha or globalCompositeOperation are not set.

Reproducible: Always

Steps to Reproduce:
Fill a canvas with white, copy it to itself repeatedly using context.drawImage(canvas, 0, 0)
(will attach testcase that does this)
Actual Results:  
Canvas slowly fades to black

Expected Results:  
Canvas remains white
Attached file testcase
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060111 Firefox/1.6a1 ID:2006011113

Confirmed
Status: UNCONFIRMED → NEW
Ever confirmed: true
This also seems to be a problem in drawWindow().

On Linux, with a 16-bit depth display, drawWindow() doesn't produce color values that are perfectly correct.  For example, white (255,255,255) pixels in the original window are rendered on the canvas as (248, 252, 248).  Solid yellow becomes (248,252,0).

Reassign to roc per irc conversation.
Assignee: nobody → roc
OS: Windows XP → All
Hardware: PC → All
I think the drawWindow issue is different.

I'm not 100% sure what's going on here. Does a white image drawn to the canvas darken at all?
drawImage using a white HTMLImageElement as a source produces a perfect result, but drawImage using a HTMLCanvasElement that is painted with rgb(255, 255, 255) as the source produces rgb(254, 254, 254).

(Thus when you wait until the counter says 255 in the test case, you'll have perfect black -- I hadn't noticed that before. Btw, the ColorZilla extension with its color picker is very useful for testing this)
Are you using a 16-bit or 24-bit display?
(In reply to comment #6)
> Are you using a 16-bit or 24-bit display?

Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060107 SeaMonkey/1.5a
I'm seeing this on a 16-bit-display, 800x600, SiS6326 graphics card 8MB
I want to know if this happens on a 24-bit display.
(In reply to comment #8)
> I want to know if this happens on a 24-bit display.
 
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060107 SeaMonkey/1.5a
Now seeing this on a 24-bit-display, 800x600, SiS6326 graphics card 8MB
this bug happens with all,

I use 32-bit
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060112 Firefox/1.6a1 ID:2006011212
The results with a globalAlpha of 0.5 or less are odd.
http://m8y.org/tmp/drawimagetest.html
Appears to work fine in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1a3) Gecko/20060526 BonEcho/2.0a3 -- propose resolving it as FIXED if someone can confirm?
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a1) Gecko/20060529 Minefield/3.0a1 ID:2006052910 [cairo]

confirmed, testcase stays white
since we don't know what fixed it -> WFM
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: