This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17577 - Problem: How to manipulate pixels of an image that can then be affected by a transformation. Example: Load an image. Change pixels by increasing red value. Display image with a rotation. Result: Cannot be done. As far as I can tell there is no way to use
Summary: Problem: How to manipulate pixels of an image that can then be affected by a ...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML Canvas 2D Context (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: rcabanie
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-22 14:08 UTC by contributor
Modified: 2012-08-23 19:59 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-06-22 14:08:58 UTC
Specification: http://www.w3.org/TR/2dcontext/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
Problem:
How to manipulate pixels of an image that can then be affected by a
transformation.

Example:
Load an image. Change pixels by increasing red value. Display image with a
rotation.

Result: Cannot be done.

As far as I can tell there is no way to use pixel manipulation on a loaded
image. 
- There is no mechanism to manipulate pixels in an image
- There is no mechanism to 'put' pixels from ImageData into an image
- There is no mechanism to apply a transform to ImageData
- There is no mechanism to drawImage ImageData

I'm either ignorant of a method or this is a serious short-coming. I recognize
that the canvas may have no business altering image pixels, but some other
mechanism needs to exist to apply transformations to manipulated canvas
pixels.

I would like to see a putImageData have a flag to indicate if transformations
should apply, or, better yet, be able to drawImage(ImageData,x,y);

Thank you,
derek@upwithabang.com


Posted from: 174.3.214.112
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Comment 1 contributor 2012-07-18 07:23:58 UTC
This bug was cloned to create bug 17960 as part of operation convergence.
Comment 2 rcabanie 2012-08-21 23:41:16 UTC
You need to create an offscreen canvas that you load your image in if you want to manipulate its pixels. So:
- create a HTMLImageElement, load the image
- create a canvas element that has the same dimensions as the image
- call drawimage to put the image into the canvas
- call getimagedata, manipulate the pixels and call putimagedata

The offscreen canvas can now be rotated/scaled/clipped on your screen canvas.
Comment 3 rcabanie 2012-08-23 19:59:54 UTC
EDITOR'S RESPONSE: 
This is an Editor'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:                      WONTFIX