[Bug 19052] New: Since context.putImageData() does not handle compositing, another set of methods, maybe context.drawImageData(), should be created to allow ImageData objects to be drawn onto the canvas in the same fashion as Image objects.

https://www.w3.org/Bugs/Public/show_bug.cgi?id=19052

           Summary: Since context.putImageData() does not handle
                    compositing, another set of methods, maybe
                    context.drawImageData(), should be created to allow
                    ImageData objects to be drawn onto the canvas in the
                    same fashion as Image objects.
           Product: HTML WG
           Version: unspecified
          Platform: All
               URL: http://www.whatwg.org/specs/web-apps/current-work/#pix
                    el-manipulation
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: HTML5 spec
        AssignedTo: dave.null@w3.org
        ReportedBy: contributor@whatwg.org
         QAContact: public-html-bugzilla@w3.org
                CC: ian@hixie.ch, mike@w3.org,
                    public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org, jackalmage@gmail.com,
                    warcraftthreeft@sbcglobal.net


This was was cloned from bug 11517 as part of operation LATER convergence.
Originally filed: 2010-12-09 21:51:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2010-12-09 21:51:03 +0000 
--------------------------------------------------------------------------------
Specification:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Section:
http://www.whatwg.org/specs/web-apps/current-work/complete.html#pixel-manipulation

Comment:
Since context.putImageData() does not handle compositing, another set of
methods, maybe context.drawImageData(), should be created to allow ImageData
objects to be drawn onto the canvas in the same fashion as Image objects.

Posted from: 173.186.242.11
================================================================================
 #1   Tab Atkins Jr.                                  2010-12-10 00:53:46 +0000 
--------------------------------------------------------------------------------
If you want to composite a whole canvas onto another canvas, you can just use
the first canvas as an argument to drawImage().  If you want to composite a
portion of a canvas onto another canvas, you can first use putImageData to draw
the portion onto a *third*, appropriately sized, canvas, and then use drawImage
with the third canvas.
================================================================================
 #2   Ian 'Hixie' Hickson                             2011-01-11 05:12:45 +0000 
--------------------------------------------------------------------------------
*** Bug 11565 has been marked as a duplicate of this bug. ***
================================================================================
 #3   Ian 'Hixie' Hickson                             2011-01-11 05:14:14 +0000 
--------------------------------------------------------------------------------
bug 11565 had the following use case description:

---------
Usage scenario. You have a large image that you want to render a portion to the
screen without overwriting the whole canvas. (Pretend part of it is
transparent). You also want the ability to change pixel info quickly and
ImageData allows that.
---------

However, I don't really understand what that means.
================================================================================
 #4   Ian 'Hixie' Hickson                             2011-01-11 07:11:13 +0000 
--------------------------------------------------------------------------------
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the tracker issue; or you may create a tracker issue
yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: I discussed this with Sirisian (bug 11565's reporter) on IRC. In
conclusion, it isn't clear to me that there is an urgent compelling need for
this. I've marked this bug LATER so that we can study it again in the future.
================================================================================
 #6   Ian 'Hixie' Hickson                             2012-02-29 22:25:46 +0000 
--------------------------------------------------------------------------------
I'll look at this again when dealing with high-res putImageData().

In general though it's not clear to me why drawImage() isn't already sufficient
here.
================================================================================
 #7   Sirisian                                        2012-03-01 17:34:02 +0000 
--------------------------------------------------------------------------------
I can't really remember why I suggested this. It was probably because of a
performance problem when rendering images. That is to say the intended
implementation of drawImageData would composite but only on integer values so
as to not take the performance hit that drawImage has when the x and y values
are rational and there is no transformation applied. However, a drawImage
implementation could special case for that to draw faster so such a method for
drawImageData seems pointless. The other perceived problem was handling of
alpha values that are binary either on or off. drawImageData would ideally be
designed to render only pixels with an alpha that isn't 0 so that no
performance is lost due to a software blending function. That is to say the
implementation of drawImageData would be identical to putImageData except it
would not copy pixels that have an alpha value of 0. Kind of a random
proposition for the sake of a sane and fast implementation. More of an edge
case in the usage of canvas.
================================================================================

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Tuesday, 25 September 2012 22:01:37 UTC