New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 13 users

Issue metadata

Status: Duplicate
Merged: issue 134040
Owner:
User never visited
Closed: Dec 2014
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Feature



Sign in to add a comment

canvas "image-rendering: optimize-contrast" doesn't work

Reported by dgs...@gmail.com, Jul 16 2013

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36

Steps to reproduce the problem:
1. add a canvas with chrome's default app res (640x400)
2. set css image-rendering: optimize-contrast;
3. set css width: 1600px; height: 900px; (hi-res fullscreen)

What is the expected behavior?
the image should be resized with "nearest neighbor" behavior

What went wrong?
image is actually blurred, resized with some other sort of not ideal algorithm

Did this work before? No 

Chrome version: 28.0.1500.72  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

actually nearest neighbor should be the default algorithm for any kind of image upscaling, antialiased ones should be the optional choice

this bug deeply impacts the development of games for the chrome web store
 
Cc: nyerramilli@chromium.org
Labels: Needs-Feedback
thanks for the report..

Can you please provide a sample HTML file/ test case , so that it would be helpful for us to reproduce the issue.

Comment 2 by tkent@chromium.org, Jul 17 2013

Labels: -Cr-UI Cr-Blink-Canvas

Comment 3 by dgs...@gmail.com, Jul 17 2013

Sure. This fiddle tries every known method of disabling interpolation. It works in other browsers, but not on Chrome:

http://jsfiddle.net/VAXrL/187/

Comment 4 by junov@chromium.org, Jul 17 2013

Labels: -Cr-Blink-Canvas Cr-Blink-CSS
optimize-contrast once existed in a CSS3 draft, but it was removed. The image-rendering property is now in CSS4.  In the current working draft of the specification, "optimize-contrast" no longer exists. 

What you are looking for is image-rendering: pixelated;

This is not yet implemented.

Flagging as a CSS issue rather than Canvas

Comment 5 by dgs...@gmail.com, Jul 17 2013

Tried with "image-rendering: pixelated;" and it didn't work either:
http://jsfiddle.net/dgsprb/VAXrL/872/
Cc: tkonch...@chromium.org
Labels: -Type-Bug -Needs-Feedback Type-Feature
Status: Untriaged
Triaging the issue as this is a feature request.
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 24 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=176839

------------------------------------------------------------------
r176839 | jackhou@chromium.org | 2014-06-24T14:05:23.106191Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-canvas.html?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-svg-image.html?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-image.html?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/css/CSSPrimitiveValueMappings.h?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-canvas-expected.txt?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/ImageQualityController.cpp?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/RenderHTMLCanvas.cpp?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/style/RenderStyleConstants.h?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-svg-image-expected.txt?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-canvas-expected.png?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/rendering/style/StyleRareInheritedData.h?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-image-expected.txt?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-svg-image-expected.png?r1=176839&r2=176838&pathrev=176839
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/css3/images/pixelated-image-expected.png?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/css/parser/BisonCSSParser-in.cpp?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/css/CSSValueKeywords.in?r1=176839&r2=176838&pathrev=176839
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/css/parser/CSSPropertyParser.cpp?r1=176839&r2=176838&pathrev=176839

Add image-rendering: pixelated.

This adds a new value "pixelated" to the "image-rendering"
property. This value sets the interpolation used when
scaling images to InterpolationNone.

Intent to implement:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Q8N6FoeoPXI

BUG= 260739 , 106662 

Review URL: https://codereview.chromium.org/336693005
-----------------------------------------------------------------
Project Member

Comment 8 by bugdroid1@chromium.org, Jul 22 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=178653

------------------------------------------------------------------
r178653 | jackhou@chromium.org | 2014-07-22T14:23:41.686330Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/sdk/CSSMetadata.js?r1=178653&r2=178652&pathrev=178653
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=178653&r2=178652&pathrev=178653

Ship image-rendering: pixelated to stable.

This also adds the value to DevTools.

Intent to Ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/zSasd2LL8Mc

BUG=317991, 106662 , 260739 , 134040 

Review URL: https://codereview.chromium.org/396063007
-----------------------------------------------------------------
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 25 2014

The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=182649

------------------------------------------------------------------
r182649 | jackhou@chromium.org | 2014-09-25T05:50:15.759817Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/devtools/front_end/sdk/CSSMetadata.js?r1=182649&r2=182648&pathrev=182649
   M http://src.chromium.org/viewvc/blink/trunk/Source/platform/RuntimeEnabledFeatures.in?r1=182649&r2=182648&pathrev=182649

Revert of Ship image-rendering: pixelated to stable. (patchset #1 id:1 of https://codereview.chromium.org/396063007/)

Reason for revert:
The bug affecting canvases also affects images that become compositor layers. Unshipping until it's fixed.

Original issue's description:
> Ship image-rendering: pixelated to stable.
> 
> This also adds the value to DevTools.
> 
> Intent to Ship:
> https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/zSasd2LL8Mc
> 
> BUG=317991, 106662 , 260739 , 134040 
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178653

TBR=vsevik@chromium.org,eseidel@chromium.org,timloh@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=317991, 106662 , 260739 , 134040 

Review URL: https://codereview.chromium.org/604683003
-----------------------------------------------------------------
Project Member

Comment 10 by bugdroid1@chromium.org, Sep 30 2014

Labels: merge-merged-2125
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=182882

------------------------------------------------------------------
r182882 | jackhou@chromium.org | 2014-09-30T03:08:14.208416Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/branches/chromium/2125/Source/devtools/front_end/sdk/CSSMetadata.js?r1=182882&r2=182881&pathrev=182882
   M http://src.chromium.org/viewvc/blink/branches/chromium/2125/Source/platform/RuntimeEnabledFeatures.in?r1=182882&r2=182881&pathrev=182882

Merge 182649 "Revert of Ship image-rendering: pixelated to stabl..."

> Revert of Ship image-rendering: pixelated to stable. (patchset #1 id:1 of https://codereview.chromium.org/396063007/)
> 
> Reason for revert:
> The bug affecting canvases also affects images that become compositor layers. Unshipping until it's fixed.
> 
> Original issue's description:
> > Ship image-rendering: pixelated to stable.
> > 
> > This also adds the value to DevTools.
> > 
> > Intent to Ship:
> > https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/zSasd2LL8Mc
> > 
> > BUG=317991, 106662 , 260739 , 134040 
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=178653
> 
> TBR=vsevik@chromium.org,eseidel@chromium.org,timloh@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=317991, 106662 , 260739 , 134040 
> 
> Review URL: https://codereview.chromium.org/604683003

TBR=jackhou@chromium.org

Review URL: https://codereview.chromium.org/612273002
-----------------------------------------------------------------
Mergedinto: 134040
Owner: jackhou@chromium.org
Status: Duplicate
This is fixed except for accelerated canvases. See the other bug for more details.

Sign in to add a comment