[html5] HTML5 canvas.toDataURL suggestions

Ian Hickson ian at hixie.ch
Tue Aug 20 16:33:50 PDT 2013

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