Replies: 3 comments 4 replies
-
It would be interesting to explore what WASM implementations of image manipulation libraries are out there. https://silvia-odwyer.github.io/photon/ looks pretty nice, it is also possible to get Python's Pillow library running in Workers through WASM (with some big caveats currently). |
Beta Was this translation helpful? Give feedback.
-
the importance of theses usecases and the pain to put them into the runtime (this would be a really bad idea for many reasons) was prob. the reason for https://blog.cloudflare.com/introducing-workers-browser-rendering-api/ |
Beta Was this translation helpful? Give feedback.
-
Wouldn't https://www.npmjs.com/package/canvaskit-wasm from Google Engineers be a possible solution? Anybody could test this? I believe the current default limit for Worker code size is set to 5MBytes, but it may be increased via https://www.cloudflare.com/larger-scripts-on-workers-early-access/ ... |
Beta Was this translation helpful? Give feedback.
-
Please support:
Just like a regular web worker in the browser would.
It would allow to redimension images and/or play with Tensorflow on the server, which is a secure environment VS the brower.
(Browser is not secure because extensions act as proxies and can break/rewrite the CSP before serving the page to the user)
This feature is constantly asked since 2019 (3 years):
Of course there is the option of using Cloudflare Images, but the use cases are limited (only for resizing).
Playing with composable primitives is prefered (image analysis, pixel per pixel, etc).
Examples
DataUrl helps browser to display inlined images.
It is useful for debugging, if you look at the second example below.
FileReader can be handy for snippets like:
Here is an example of createImageBitmap, Offscreen Canvas, FileReader working together:
Having this kind of primitives is interesting, because in Machine Learning, developers often need to resize, grayscale, extract alpha... and perform various and lots of granular operations.
Beta Was this translation helpful? Give feedback.
All reactions