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 18631 - [Proposal] Using URL.createObjectURL in ImageData (creating image)
Summary: [Proposal] Using URL.createObjectURL in ImageData (creating image)
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 03:35 UTC by contributor
Modified: 2012-10-16 18:38 UTC (History)
7 users (show)

See Also:


Attachments
ImageData example (copy) (2.19 KB, text/html)
2012-08-25 08:14 UTC, Alexei03a
Details
Description (Russian, adaptive) (2.24 KB, text/plain)
2012-08-25 08:14 UTC, Alexei03a
Details

Description contributor 2012-08-21 03:35:13 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/
Multipage: http://www.whatwg.org/C#head
Complete: http://www.whatwg.org/c#head

Comment:
I have idea for add URL.createObjectURL for ImageData objects. ImageData gets
superpowers - he can be image in CSS background, <img> and other elements.
ImageData can be animated, you can create unstandart image formats, custom
animations and filters.

Posted from: 95.188.224.22 by alexei03a@gmail.com
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1
Comment 1 Alexei03a 2012-08-21 03:40:57 UTC
I have idea for ImageData as image. For this, require make string link with URL.createObjectURL() in ImageData object.
Comment 2 Alexei03a 2012-08-21 03:45:04 UTC
Please, remove my first comment, because is outdated.
Comment 3 Alexei03a 2012-08-21 03:45:55 UTC
i.e. Description
Comment 4 Alexei03a 2012-08-21 04:40:34 UTC
The idea of ​​using the image ImageData was given to me at once. At first I thought at all to use the Canvas element in the quality of content in images. But then I decided that the best solution is to use ImageData as images. Use it in CSS backgrounds, as well as in the src <img>. To create ImageData image to make a link to it:

URL.createObjectURL(ctx.createImageData(w,h));

This is only a primitive use, this technique can be applied for decoding images, using filters, as well as animation and plug-ins.

1. ImageData is a fixed size
2. High performance (no encoding / decoding)
3. Security Policy (on getImageData)
4. ImageData object reference instead of Base64 encoded image in PNG (similar to the Blob)
5. Speaker (you can change the pixel, is it reflected in the image)
6. Generated only with scripts

Writed on Google Translate.
Comment 5 Simon Pieters 2012-08-21 09:08:14 UTC
Please, less noise when filing bugs.

What is the problem you're trying to solve with your idea?
Comment 6 Alexei03a 2012-08-21 09:28:40 UTC
Will be very difficult to understand.

The bottom line is that I want to make a plug in JavaScript, which can decode an image (for example APNG), but the result is we need a way to insert IMG etc. ToDataURL method has several disadvantages, such as the "static" and "a huge resource consumption." ImageData is flexible and does not expend resources (given the fact that it was rendering and exporting from Canvas), it can also be applied with the Worker.

The fact is that in the language C, animation or image is constructed by analogy with ImageData.

Also with ImageData can generate captcha-picture a trick.

Problems of course is not enough, here are some of them:
- Decoding images (rendering the result, I sort of wrote about above)
- Filters for images (and not only)
- Watermarks (protection from inexperienced users)
- Manipulating pixels and animation (useful for first item)
- Generated Image (RGBA32 and animation, though not necessarily)
- Someone just for experimentation :)
Comment 7 Alexei03a 2012-08-21 10:29:55 UTC
For canvas (only) security addition:

/!\ Drawing <img> element, with link of "ImageData" object, to HTMLCanvasElement must throw "Security Error", because draw first frame is unreal.

For canvas, only ctx.putImageData, or long operation:

temp.canvas.width  = imagedata.width;
temp.canvas.height = imagedata.height;
temp.putImageData(imagedata,0,0);
ctx.drawImage(temp.canvas, ...);
Comment 9 Alexei03a 2012-08-21 13:52:34 UTC
There is an important request - to prepare the specification and I myself can not. I have already suggested that we should do.
Comment 10 Alexei03a 2012-08-21 14:00:08 UTC
Testcase is outdated, looks: https://bug783942.bugzilla.mozilla.org/attachment.cgi?id=653739
Comment 11 Michael[tm] Smith 2012-08-21 14:26:14 UTC
Alexei03a .

Please be more considerate of other peoples' time when posting comments to bugzilla. You posted 8 comment for this just one bug over the last day. That's excessive. Some of us get a separate notification every time you post a comment here. And most of them are not important comments.
Comment 12 Kyle Huey 2012-08-21 16:36:58 UTC
There's a fundamental problem here.  ImageData is mutable, while Blob and File are not.  Creating URLs to ImageData objects could be racy.
Comment 13 Jay Munro 2012-08-21 21:21:13 UTC
This appears to be a new feature, so moving to HTML.next.
Comment 14 Jay Munro 2012-08-23 20:47:07 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: Information Needed

    Rationale: This appears to be a new feature, so moving to HTML.next.
Comment 15 Alexei03a 2012-08-24 06:36:25 UTC
Finally, where to send the proposal to whatwg and w3c? The more URL.createObjectURL for ImageData's exactly the idea, suggestion.
Comment 16 Ian 'Hixie' Hickson 2012-08-24 18:08:19 UTC
If you wish to propose a feature to the WHATWG, please either file a bug on the WHATWG product, HTML component, or e-mail the list mentioned at: http://whatwg.org/mailing-list#specs
Comment 17 Alexei03a 2012-08-25 04:00:14 UTC
I still have not described the nature of the bug. And the essence of the bug is that the need to make it possible to use functions URL.createObjectURL to objects of type ImageData. You anywhere in the specifications about it did not say anything, because of what browsers do not support this (and will not be supported). I earlier said that ImageData will be very useful as an image.

I apologize for not having provided any description or nature of things.
Comment 18 Alexei03a 2012-08-25 04:05:06 UTC
I use a translator from Google, and there may be some errors in the translation.

I have to use the images ImageData see more good than harm. Any scripts are harmful to some extent. :)
Comment 19 Alexei03a 2012-08-25 05:07:17 UTC
I still give a lot of detail.
Link to ImageData should look like this:

[optional-browser-prefix]imagedata:[url][code]

When the browser accesses this link in the ImageData object, that in turn, is drawn directly into the IMG, if there was a change of pixels, the image should also reflect this change. Should not be displayed immediately after each change, but only after a group of changes (short animation, FPS).
Comment 20 Alexei03a 2012-08-25 05:11:04 UTC
[url] i.e. site url.
Comment 21 Alexei03a 2012-08-25 07:36:54 UTC
From this and subsequent posts, I will write a copy of the text in Russian (which is the original).

As it was better to write a new bug, or modify this?
RUS: Как лучше было, написать новый баг, или модифицировать этот?
Comment 22 Alexei03a 2012-08-25 08:14:21 UTC
Created attachment 1177 [details]
ImageData example (copy)
Comment 23 Alexei03a 2012-08-25 08:14:48 UTC
Created attachment 1178 [details]
Description (Russian, adaptive)
Comment 24 Ian 'Hixie' Hickson 2012-10-16 18:38:47 UTC
You can already convert ImageData objects to URLs, just draw them to a canvas and them call toBlobURL on the canvas.