[html5] HTML5 canvas.toDataURL suggestions

Sigurd Lerstad sigurd.lerstad at gmail.com
Wed Aug 21 04:27:14 PDT 2013


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.   `._.-(,_..'--(,_..'`-.;.'




More information about the Help mailing list