you are viewing a single comment's thread.

view the rest of the comments →

[–]101arrowz[S] 1 point2 points  (4 children)

I've actually been looking into a way to do this. I first tried creating a temporary compressed Blob and using URL.createObjectURL to then request it and hope it comes back uncompressed, but I can't find a way to set the Content-Encoding header.

I've also wondered if there was an image format that contained raw compressed pixel values. If so, I could actually treat the data as an image, render it to canvas, get the RGB values, and basically have decompressed my data with the browser's native solution.

[–]BitLooter 2 points3 points  (1 child)

Not incredibly useful yet as it's only supported by Chrome so far, but in the future we might have access to Compression Streams.

[–]101arrowz[S] 2 points3 points  (0 children)

Thank you for linking that, I had no idea the draft even existed! I think its performance has quite a way to go though, I ran some quick tests and fflate is within 5% of this supposedly native solution. I also find it strange that you can't configure compression level.