开发者

Is there a way to set GIF RLE compress when calling Canvas.toDataUrl()?

开发者 https://www.devze.com 2023-03-20 22:21 出处:网络
I\'m working on a minimalist image creation project and I need to have the ability to create images within the browser that are uploaded and used on a server.

I'm working on a minimalist image creation project and I need to have the ability to create images within the browser that are uploaded and used on a server.

I've managed to create the image data for the server via calling the toDataUrl() method on my canvas object. Specifically, I create m开发者_运维知识库y image by calling toDataUrl('image/gif') but the resulting image is not RLE compressed. Is there a way that I can force the toDataUrl method to create a compressed GIF?


The spec leaves it up to the browser on how to implement the GIF mime type. The only guaranteed MIME in the spec is image/png

So unfortunately, even if you're lucky enough that the browser will generate GIF, there doesn't seem to be any browsers currently that take RLE into consideration.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号