<?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>12044</bug_id>
          
          <creation_ts>2011-02-12 00:08:25 +0000</creation_ts>
          <short_desc>Feature request: Give developers an option to disable a context&apos;s image smoothing</short_desc>
          <delta_ts>2012-03-28 21:46:15 +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 HTML Canvas 2D Context</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#top</bug_file_loc>
          <status_whiteboard>canvas v5</status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>stack413</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>45414</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-02-12 00:08:25 +0000</bug_when>
    <thetext>Specification: 
Section: http://www.whatwg.org/specs/web-apps/current-work/complete.html#top

Comment:
This is a new feature request.

Request overview: Give developers an option to disable a context&apos;s image
smoothing (ie, anti-assailing).

Problem: When scaling up images, most user agents smooth the output. This is
fine for most use cases, but is undesirable when &quot;pixel-perfect&quot; output is
desired. Unfortunately, there is nothing in the spec that allows a user to
turn off this smoothing. 

I ran into this issue when I was creating a canvas based image editor. In
particular, it more or less torpedoed my first attempt at creating a zoom
feature. Simply put, when I tried to show a &quot;zoomed in&quot; view of a smaller base
image, the &quot;pixels&quot; of the zoomed view were anti-assailed and bled into each
other. The effect was ugly and (more importantly) non-representative of the
actual image being edited, which nicely defeated the purpose of an image
editor. 

Currently the only solution is to roll your own scaling algorithms based on
imageData, which is less than ideal.

Use cases: Any application where a developer needs &quot;pixel perfect&quot; scaling.
Examples include image editors, pixel art, pixel animations, and cases where
developers want to avoid any computational overhead associated with smoothing.



Solution: Codify an existing implementation (see below). My image editor
looked great in Firefox! 

A more complicated solution could allow a developer to specify a specific
smoothing algorithm. Something along the lines of
&quot;context.smoothing(&apos;bicubic&apos;).&quot;

Existing implementation: &quot;Gecko 1.9.2 introduced the mozImageSmoothingEnabled
property to the canvas element; if this Boolean value is false, images won&apos;t
be smoothed when scaled. This property is true by default.&quot; Source:
https://developer.mozilla.org/en/Canvas_tutorial/Using_images#Controlling_imag
e_scaling_behavior

Posted from: 65.185.139.106</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45417</commentid>
    <comment_count>1</comment_count>
    <who name="Scott A">stack413</who>
    <bug_when>2011-02-12 00:14:13 +0000</bug_when>
    <thetext>Sorry this clobbeed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45420</commentid>
    <comment_count>2</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-02-12 00:30:48 +0000</bug_when>
    <thetext>This is handled in CSS through the &apos;image-rendering&apos; property &lt;http://dev.w3.org/csswg/css3-images/#image-rendering&gt;.  It would be nice to hook into this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45659</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-16 08:27:18 +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: Partially Accepted
Change Description: none yet
Rationale: I don&apos;t usually like this kind of feature, because it relies on authors making good judgements and that has historically not been a successful strategy for Web browser vendors. However, in this particular case the issue isn&apos;t really about optimisation (as it is for &apos;image-rendering&apos;), it&apos;s about a very concrete desire to actually see the pixels blown up. This is something we probably _should_ address.

I&apos;ve marked this &quot;LATER&quot;, so we don&apos;t lose track of it. However, now is not a great time to add this, because before adding more new features we should first let the browsers catch up to what we&apos;ve already specced.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>52660</commentid>
    <comment_count>4</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:03:28 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64750</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-29 18:53:22 +0000</bug_when>
    <thetext>Just adding context.imageSmoothingEnabled = boolean seems reasonable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64786</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-29 22:50:14 +0000</bug_when>
    <thetext>Current proposal at: http://wiki.whatwg.org/wiki/Canvas#Image_smoothing</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66188</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-03-28 21:46:15 +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: Accepted
Change Description: imageSmoothingEnabled for drawImage
Rationale: Concurred with reporter&apos;s comments.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>