Skip to content
Discussion options

You must be logged in to vote

Perhaps Sharp will work in a browser someday (partial progress in lovell/sharp#3522) but it doesn't yet. textureCompress() works in a browser in v3.6, just omit the encoder argument, but it is limited to compressing with the browser's own PNG/JPEG codecs. I don't think you'll find that it helps very much, unless the (a) the original compression on the images was fairly poor, or (b) you're converting to a more efficient format like WebP.

If you are aware of an image compression library you'd like to use instead, then you might be better off just writing that function yourself. See #853 (comment) for an example of how this could be done.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@neciszhang
Comment options

@donmccurdy
Comment options

Answer selected by neciszhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants