<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>11431</bug_id>
          
          <creation_ts>2010-11-30 01:11:46 +0000</creation_ts>
          <short_desc>should mention that .toDataURL() for image/jpeg acts as if the image was composited against black</short_desc>
          <delta_ts>2011-09-29 08:16:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#the-canvas-element</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>excors</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>mikelawther</cc>
    
    <cc>noel.gordon</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>42867</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-11-30 01:11:46 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/complete.html
Section: http://www.whatwg.org/specs/web-apps/current-work/#the-canvas-element

Comment:
should mention that .toDataURL() for image/jpeg acts as if the image was
composited against black

Posted from: 76.102.14.57</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42868</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-11-30 01:20:12 +0000</bug_when>
    <thetext>Actually mozilla and safari apparently don&apos;t do that, they instead unpremultiply the colours. Either way, this needs speccing.

Philip, I&apos;m told you have tests for this that may not match implementations? Can you elaborate? Specifically, this one: http://philip.html5.org/tests/canvas/suite/tests/toDataURL.jpeg.alpha.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42886</commentid>
    <comment_count>2</comment_count>
    <who name="Philip Taylor">excors</who>
    <bug_when>2010-11-30 11:16:05 +0000</bug_when>
    <thetext>The spec already says:

  &quot;For image types that do not support an alpha channel, the image must be composited onto a solid black background using the source-over operator, and the resulting image must be the one used to create the data: URL.&quot;

so I think it&apos;s clear on what&apos;s required (which is what that test tests).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42937</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-12-01 00:31:44 +0000</bug_when>
    <thetext>So it does.

This doesn&apos;t seem to match what WebKit and Gecko do. Should we change the spec?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43058</commentid>
    <comment_count>4</comment_count>
    <who name="Philip Taylor">excors</who>
    <bug_when>2010-12-04 23:48:47 +0000</bug_when>
    <thetext>Trying http://philip.html5.org/demos/canvas/jpeg-alpha.html with some variously old browsers:

Firefox (3.6): returns (r, g, b, 1).
Opera (10.60): returns (r, g, b, 1).
IE9 (some not-quite-latest preview): blends with black.
Safari (4.03 Win): blends with white.
Chrome (8.0 Win): doesn&apos;t support JPEG.

Doesn&apos;t look like there&apos;s really any convergence on one behaviour, so I&apos;d guess the spec should define whatever seems the most sensible behaviour and then hope they converge in that direction.

(I don&apos;t know what&apos;s really the most sensible behaviour, but what the spec says sounds plausible to me.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43372</commentid>
    <comment_count>5</comment_count>
    <who name="Noel Gordon">noel.gordon</who>
    <bug_when>2010-12-15 07:23:17 +0000</bug_when>
    <thetext>(In reply to comment #4)

My results running http://philip.html5.org/demos/canvas/jpeg-alpha.html

Firefox 3.6.12 win32
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,62,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,62,255,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(1,59,255,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(1,59,255,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)

Chrome 10 dev win32
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,62,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,62,255,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(1,61,255,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(1,61,255,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)

Safari 5.0.2 win32
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,62,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,62,255,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(1,61,255,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(1,61,255,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(255,255,255,1)  &lt;-- bug composites on white
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(255,255,255,1)  

Opera 10.63 Win32
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,64,253,1)
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,64,253,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,63,252,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,63,252,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(0,56,244,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(0,56,244,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)

For alpha != 0.0
 results are the same neglecting rounding effects.
For alpha == 0.0
 composites on black (except safari, that is a safari bug).


Philip, can you add your full results for IE9?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43419</commentid>
    <comment_count>6</comment_count>
    <who name="Noel Gordon">noel.gordon</who>
    <bug_when>2010-12-15 23:40:10 +0000</bug_when>
    <thetext>No worries, mike computed the results for me.

IE9 9.0.7930.16406 beta
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,32,127,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(0,6,25,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(0,32,127,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(0,6,25,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>43472</commentid>
    <comment_count>7</comment_count>
    <who name="Noel Gordon">noel.gordon</who>
    <bug_when>2010-12-20 07:38:59 +0000</bug_when>
    <thetext>I&apos;ve posted a webkit patch to make chromium conform with the standard for
review https://bugs.webkit.org/attachment.cgi?id=76964&amp;action=prettypatch

Chrome 10 dev Win32 + above patch
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,1.0); format: image/jpeg; output: rgba(0,63,255,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(1,31,127,1)
 Input: rgba(0,63,255,0.5); format: image/jpeg; output: rgba(1,31,127,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(0,6,25,1)
 Input: rgba(0,63,255,0.1); format: image/jpeg; output: rgba(0,6,25,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)
 Input: rgba(0,63,255,0.0); format: image/jpeg; output: rgba(0,0,0,1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44199</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-01-11 19:38:35 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;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:

Based on the above, I&apos;m going to reject this bug and leave it as is. Please do not hesitate to reopen it if I am mistaken in doing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47549</commentid>
    <comment_count>9</comment_count>
    <who name="Noel Gordon">noel.gordon</who>
    <bug_when>2011-04-19 01:04:02 +0000</bug_when>
    <thetext>https://bugzilla.mozilla.org/show_bug.cgi?id=650720</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53791</commentid>
    <comment_count>10</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:17:23 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57499</commentid>
    <comment_count>11</comment_count>
    <who name="Noel Gordon">noel.gordon</who>
    <bug_when>2011-09-29 08:16:44 +0000</bug_when>
    <thetext>Safari (webkit nightly) and Chromium Mac now conform after change
http://trac.webkit.org/changeset/96000</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>