[html5] HTML5 canvas.toDataURL suggestions

Rik Cabanier cabanier at gmail.com
Wed Aug 21 09:32:54 PDT 2013


Why don't you crosscompile libpng and libjpeg  to JavaScript with
empscripten and do the recoding yourself?
You can use web workers if the compression is slow and you don't want to
block the main window.


On Wed, Aug 21, 2013 at 4:27 AM, Sigurd Lerstad <sigurd.lerstad at gmail.com>wrote:

>
> Thank you Ian, for your response.
> The use case for my canvas.toDataURL improvements is making a paint/drawing
> program and presenting more options to the user when exporting to a file
> format. It's as simple as that. As for your point of sending to a server,
> what if a server isn't available, what if this is an offline app?
> Anyway... I personally missed more control when developing my online paint
> program, but I see why this is special.
>
>
> -----Original Message-----
> From: Ian Hickson [mailto:ian at hixie.ch]
> Sent: 21. august 2013 01:34
> To: Sigurd Lerstad
> Cc: help at whatwg.org
> Subject: Re: [html5] HTML5 canvas.toDataURL suggestions
>
> On Sat, 18 May 2013, Sigurd Lerstad wrote:
> >
> > I suggest improving / making more flexible the canvas.toDataURL API
> >
> > The API is currently called with a second quality argument for the
> > JPEG and WebP formats, and no second argument for the PNG format:
> >
> > toDataURL(type, quality);  // JPEG and WebP
> > toDataURL(type);           // PNG
> >
> > I suggest the following possibilities as well:
> >
> >              grayscale: true/false,     // since the JPEG format also
> > supports grayscale images at smaller files sizes
>
> What's the use case?
>
>
> >              progressive: true/false
>
> What's the use case for controlling this?
>
>
> To be perfectly honest, I don't really understand why we'd want to expose
> as
> a lossy format at all. It seems better to get the whole data to the server,
> and then let the server do whatever it needs to do (convert to JPEG, etc)
> for long-term use of the data.
>
>
> >              interlaced: true/false,
> >              grayscale: true/false,
> >              alpha: true/false,
> >
> > Some means of creating 8bit color indexed PNG would also be nice.
>
> Nice for what? I don't really understand the use cases here.
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>
> _______________________________________________
> Help mailing list
> Help at lists.whatwg.org
> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20130821/0a0fe2a5/attachment-0003.htm>


More information about the Help mailing list