1

I want to send a canvas with transparency. Unfortunetly the rendered canvas as PNG is very big. Is there anything I can do to make it smaller for the transferring?

var canvasPNG = canvas.toDataURL();  //sending it to the server
4

1 回答 1

1

如果您将其作为带有 alpha 通道的 png 发送,则并非如此。

可以做的是将图像作为两个 jpeg 图像发送:一个包含 rgb 的图像,另一个代表 alpha 通道的灰度图像,然后从这些图像在服务器上创建一个 png。

于 2013-06-30T13:41:38.200 回答