[Bug 12044] New: This is a new feature request. Request overview: Give developers an option to disable a context'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 undesirabl

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12044

           Summary: This is a new feature request. Request overview: Give
                    developers an option to disable a context'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 undesirabl
           Product: HTML WG
           Version: unspecified
          Platform: Other
               URL: http://www.whatwg.org/specs/web-apps/current-work/#top
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P3
         Component: HTML Canvas 2D Context (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: contributor@whatwg.org
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


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'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 "pixel-perfect" 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 "zoomed in" view of a smaller base
image, the "pixels" 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 "pixel perfect" 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
"context.smoothing('bicubic')."

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

Posted from: 65.185.139.106

-- 
Configure bugmail: http://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 Saturday, 12 February 2011 00:08:27 UTC