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 25647 - ImageBitmap: Have a way to turn an ImageBitmap into a renderable <img> or <canvas> efficiently
Summary: ImageBitmap: Have a way to turn an ImageBitmap into a renderable <img> or <ca...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 enhancement
Target Milestone: Needs Impl Interest
Assignee: Justin Novosad
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-09 21:47 UTC by Ian 'Hixie' Hickson
Modified: 2016-04-21 14:37 UTC (History)
4 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2014-05-09 21:47:57 UTC
On Tue, 17 Dec 2013, David Flanagan wrote:
>
> Once a large image is decoded and downsampled into a smaller
> ImageBitmap, the only thing that we can do with that ImageBitmap is to
> copy it into a Canvas, either for display to the end user (as an
> alternative to an <img>) or for re-encoding with Canvas.toBlob() (when
> creating thumbnails for large images). The motivation for this
> downsampling feature is memory use. But having to copy an ImageBitmap
> into a canvas in order to use it immediately doubles the amount of
> memory required. So for this reason, I also want to propose that
> ImageBitmap have a transferToCanvas() method akin to the
> transferToImageBitmap() and transferToImage() methods proposed at
> http://wiki.whatwg.org/wiki/WorkerCanvas.  transferToCanvas would
> transfer the image data into a new Canvas object and would neuter the
> ImageBitmap so that it could no longer be used.
Comment 1 Justin Novosad 2016-04-11 20:20:55 UTC
WIP: https://github.com/whatwg/html/pull/1028
Comment 2 Domenic Denicola 2016-04-11 21:14:20 UTC
Note that https://github.com/whatwg/html/pull/1028 covers the transfer-to-canvas case. That is probably enough for most situations. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23502 talks a bit about the img case, although that API is more likely to be copying than transferring.