

Show HN: Image manipulation web worker proof of concept - davidjeliba
https://github.com/davidjeliba/imageworker

======
davidjeliba
I was playing around with Web Workers and saw a bit of a gap when it came to
image manipulation. A lot of examples provided for browser based image
manipulation relied on the canvas api which workers do not have an interface
to.

Using the JPEG decoder from the Mozilla pdf.js project as well as a JPEG
encoder from Adobe I demonstrate how you can do somewhat heavy lifting in the
front end for images without locking the main thread.

It works in Chrome for the moment but should work in any browser that allows
FileReader in the workers (FireFox only allows FileReaderSync) but I could get
that to behave nicely so FireFox is unsupported for now.

Also the output image will probably be artifacted but I wasn't focusing on
quality just yet.

One interesting thing seems to be that there is very little difference in
processing time between the single worker vs. multiple workers examples.

