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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>40881</bug_id>
          
          <creation_ts>2010-06-19 14:18:28 -0700</creation_ts>
          <short_desc>Authors require control over image interpolation methods</short_desc>
          <delta_ts>2022-12-29 21:37:53 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="pixelguy">eyereight</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>adam</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>grantgalitz</cc>
    
    <cc>hyatt</cc>
    
    <cc>jurekraben</cc>
    
    <cc>jurekraben</cc>
    
    <cc>kaisellgren</cc>
    
    <cc>kling</cc>
    
    <cc>ledermann</cc>
    
    <cc>martin</cc>
    
    <cc>mdelaney7</cc>
    
    <cc>mikelawther</cc>
    
    <cc>peter</cc>
    
    <cc>plummer.andrew</cc>
    
    <cc>senorblanco</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>Tiny_grasshopper</cc>
    
    <cc>webkit-bugzilla</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>240383</commentid>
    <comment_count>0</comment_count>
    <who name="pixelguy">eyereight</who>
    <bug_when>2010-06-19 14:18:28 -0700</bug_when>
    <thetext>As a web author, i (and many others) desperately desire control over whether or not an image should be scaled using biliniar/bicubic filtering methods, or low-quality nearest-neighbor method when setting its width/height properties.

Many pixel art and avatar centric sites, forums and communities utilize scripts which resize their images both statically and dynamically as being an integral part of that websites core function. As a result, once clean, precise pixel-perfected images are now displaying in a fuzzy/blurry fashion, and is negatively affecting the aesthetic of many websites. 

In addition, there are many authors who would prefer performance increase over image quality increase, and have also supported the viewpoint of allowing an author to choose. 

Mozilla and Microsoft have both identified this issue as it was brought to them by these disgruntled communities and both have sought (correctly so) to include vendor-specific CSS solutions to allow authors to choose their method of interpolation. Including a similar CSS solution for webkit based browsers would be ideal. 

a direct url to Mozilla&apos;s documentation regarding this fix and examples of how this affects desired image rendering can be found here:

https://developer.mozilla.org/en/css/image-rendering

Until authors are given the choice on how to control image interpolation for all of the major browsers, these communities will be forced to support Mozilla and Microsoft browsers unanimously (more likely the former).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>241250</commentid>
    <comment_count>1</comment_count>
    <who name="FTPlus">Tiny_grasshopper</who>
    <bug_when>2010-06-22 07:57:15 -0700</bug_when>
    <thetext>I plead for this too. Even more for W3C to implement this in a more general way, but meanwhile we really need this. I know numerous communities that could benefit from this since pixel-art really needs nearest neighbour filtering resizing for it to look nothing but decent. What happens now is that people scale it in an image editor and upload it. This means that file sizes are unnecessary large, thus load slower, overall a setback.

For now something like &apos;-webkit-interpolation-mode: nearest-neighbor;&apos; would be peaches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>292333</commentid>
    <comment_count>2</comment_count>
    <who name="mrtnkl">martin</who>
    <bug_when>2010-10-10 11:28:46 -0700</bug_when>
    <thetext>Lack of control of image scaling is a step backward for the user experience at my 4-bit-centric game site at sarien.net. I just set up a way to use the lowest size of images and upscale them by CSS, but webkit makes the blurry. Just like firefox does, however, ff supports a css rule to override this.

I really hope this gets implemented!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321280</commentid>
    <comment_count>3</comment_count>
    <who name="Jurek R.">jurekraben</who>
    <bug_when>2010-12-13 11:32:32 -0800</bug_when>
    <thetext>Yes please implement it! It&apos;s important for background-fullscreen animations and transitions, to get a better performance.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>321343</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2010-12-13 12:44:51 -0800</bug_when>
    <thetext>This is being discussed on www-style:
&lt;http://lists.w3.org/Archives/Public/www-style/2010Dec/0029.html&gt;

If you have constructive comments, please make them on that list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370241</commentid>
    <comment_count>5</comment_count>
    <who name="Grant Galitz">grantgalitz</who>
    <bug_when>2011-03-20 15:16:53 -0700</bug_when>
    <thetext>Having this implemented would help webkit browsers greatly for http://code.google.com/p/chromium/issues/detail?id=76865</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370242</commentid>
    <comment_count>6</comment_count>
      <attachid>86285</attachid>
    <who name="Grant Galitz">grantgalitz</who>
    <bug_when>2011-03-20 15:17:52 -0700</bug_when>
    <thetext>Created attachment 86285
Test to show the slowness with webkit scaling a canvas blitted to at a target 62.5 fps</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>370244</commentid>
    <comment_count>7</comment_count>
    <who name="Grant Galitz">grantgalitz</who>
    <bug_when>2011-03-20 15:21:28 -0700</bug_when>
    <thetext>image-rendering: -webkit-crisp-edges
-or-
image-rendering: crisp-edges

Both would be fine for me. This is the &quot;moz&quot; format, and it does seem a little better than the interpolation-mode property of MS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>406831</commentid>
    <comment_count>8</comment_count>
    <who name="Mike Lawther">mikelawther</who>
    <bug_when>2011-05-19 19:11:15 -0700</bug_when>
    <thetext>The proposed value for CSS3&apos;s image-rendering &apos;optimize-contrast&apos; has been implemented as &apos;-webkit-optimize-contrast&apos; in bug 56627. Right now in WebKit, using this will get you nearest-neighbour interpolation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542005</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-01-24 22:12:48 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 56627 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>637827</commentid>
    <comment_count>10</comment_count>
    <who name="Alan Hogan">webkit-bugzilla</who>
    <bug_when>2012-05-30 16:56:28 -0700</bug_when>
    <thetext>There is still no way to guarantee nearest-neighbor, which is really disappointing for exactly-square and/or &quot;pixel&quot; graphics.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>638354</commentid>
    <comment_count>11</comment_count>
    <who name="Stephen White">senorblanco</who>
    <bug_when>2012-05-31 06:50:26 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; There is still no way to guarantee nearest-neighbor, which is really disappointing for exactly-square and/or &quot;pixel&quot; graphics.

For &lt;canvas&gt;, you can now use 

ctx.webkitImageSmoothingEnabled = false

to obtain nearest-neighbor interpolation.  This should be available in WebKit nightlies and the Chrome Canary.  This is orthogonal to the CSS change, which is still a work-in-progress AFAIK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>638724</commentid>
    <comment_count>12</comment_count>
    <who name="Grant Galitz">grantgalitz</who>
    <bug_when>2012-05-31 14:36:02 -0700</bug_when>
    <thetext>A couple of weeks ago I churned up a scaling library in js that does the scaling in js math with no canvas interaction for the scaling part. The &quot;crisp&quot; scaling mode at the bottom might be of interest to someone. It uses an algorithm that is superior to nearest-neighbor (doesn&apos;t drop pixels or unevenly weight them), but will look like nearest neighbor on integer scaling factors.
http://www.grantgalitz.org/image_resize/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>638726</commentid>
    <comment_count>13</comment_count>
    <who name="Grant Galitz">grantgalitz</who>
    <bug_when>2012-05-31 14:38:50 -0700</bug_when>
    <thetext>OUCH, just realized Google Chrome fails to update its rendering after the scaling is done, the linked page is testable in firefox at least. Opening dev tools for chrome strangely &quot;fixes&quot; the missing images.

Also, the algos: https://github.com/grantgalitz/JS-Image-Resizer/blob/master/resize.js</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>638811</commentid>
    <comment_count>14</comment_count>
    <who name="Mike Lawther">mikelawther</who>
    <bug_when>2012-05-31 16:46:30 -0700</bug_when>
    <thetext>The image-rendering property was bumped from CSS Images Level 3 to Level 4.

The *very early* draft of Level 4 (http://dev.w3.org/csswg/css4-images/Overview.src.html) includes a &apos;pixelated&apos; value for image-rendering.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>639144</commentid>
    <comment_count>15</comment_count>
    <who name="Jurek Raben">jurekraben</who>
    <bug_when>2012-06-01 03:03:22 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; OUCH, just realized Google Chrome fails to update its rendering after the scaling is done, the linked page is testable in firefox at least. Opening dev tools for chrome strangely &quot;fixes&quot; the missing images.
&gt; 
&gt; Also, the algos: https://github.com/grantgalitz/JS-Image-Resizer/blob/master/resize.js

Yes, I also experienced this kind of bug:

Especially if a resized background is displayed with hardware acceleration (using style sheet command: -webkit-transform: translateZ(0) ), sometimes Chrome only shows a black box.

This should be opened as a new bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>820233</commentid>
    <comment_count>16</comment_count>
    <who name="Flo Ledermann">ledermann</who>
    <bug_when>2013-01-30 08:49:30 -0800</bug_when>
    <thetext>How can this be closed as a duplicate when the referenced bug is just about implementing *one* of the alternatives? Please reopen, this is not fixed!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1145529</commentid>
    <comment_count>17</comment_count>
    <who name="Andrew Plummer">plummer.andrew</who>
    <bug_when>2015-12-01 23:31:50 -0800</bug_when>
    <thetext>Also experiencing this issue. Would love to have more control over resizing methods. Downsizing right now is producing blurry results (not horrible but definitely noticeable) even for standard JPG photos. image-rendering: -webkit-optimize-contrast has almost no noticeable effect and image-rendering: pixelize doesn&apos;t work on photos (far too much contrast). In this new era of responsive design and with image-size: cover/contain, the lack of this feature is starting to be more and more of an issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1145571</commentid>
    <comment_count>18</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2015-12-02 08:35:42 -0800</bug_when>
    <thetext>Can you point to some content that demonstrates sub-par image downsizing quality?

Reopening, because I don&apos;t think that just auto/crisp-edges/pixelated is enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1145589</commentid>
    <comment_count>19</comment_count>
    <who name="Andrew Plummer">plummer.andrew</who>
    <bug_when>2015-12-02 09:27:33 -0800</bug_when>
    <thetext>OK, here&apos;s a decent example (one I was called on to &quot;fix&quot;): http://codepen.io/andrewplummer/pen/JGPMeg

Left block is fitting exact height. Center block is the same image resized by 1px in the browser (image-size: cover). Right image is a different image resized in Photoshop using nearest neighbor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882280</commentid>
    <comment_count>20</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-11 17:17:12 -0700</bug_when>
    <thetext>The relevant website no longer exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922232</commentid>
    <comment_count>21</comment_count>
    <who name="Alan Hogan">webkit-bugzilla</who>
    <bug_when>2022-12-29 15:00:21 -0800</bug_when>
    <thetext>Perhaps more accurately, andrewplummer&apos;sst CodePen is broken because Dropbox stopped allowing hotlinked resources some years ago, removing the source of the images used in the CodePen.

However, the demo page at https://developer.mozilla.org/en-US/docs/Web/CSS/image-rendering still works, and it shows that Safari does in fact honor `image-rendering: pixelated` so this bug may be resolved</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922254</commentid>
    <comment_count>22</comment_count>
    <who name="Andrew Plummer">plummer.andrew</who>
    <bug_when>2022-12-29 21:37:53 -0800</bug_when>
    <thetext>Cannot comment on the feature, however I fixed the pen!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>86285</attachid>
            <date>2011-03-20 15:17:52 -0700</date>
            <delta_ts>2011-03-20 15:17:52 -0700</delta_ts>
            <desc>Test to show the slowness with webkit scaling a canvas blitted to at a target 62.5 fps</desc>
            <filename>url.txt</filename>
            <type>text/plain</type>
            <size>46</size>
            <attacher name="Grant Galitz">grantgalitz</attacher>
            
              <data encoding="base64">aHR0cDovL3d3dy5ncmFudGdhbGl0ei5vcmcvY2FudmFzdGVzdGNhc2UuaHRtbA==
</data>

          </attachment>
      

    </bug>

</bugzilla>