Open kui opened 5 years ago
createImageBitmap(file);
then drowImage(bitmap, 0, 0)
for a canvas drows all pixels which are rgba=(0, 0, 0, 0), So it drops rgb values.getContext("2d", { alpha: false })
is the same result.Web browsers might drop rgb values of pixels which the alpha value is 0.
Or WebAssembly SIMD in Beta Chrome 84?
Splat convert is now fast enough by 026258dab05f61291b4a8cc5dc4c07edf5c4fd70. It takes vast time that slice
creates new array instance.
This issue should treat about pngjs.pack()
into Blob
. It takes about 14 secs in my env yet.
Avoid to use pngjs.pack()
in bcfcf17c103046944f667a914febcd11772d80b9.
I will try wasm for PNG parsing.
Rust png with wasm parses faster than pngjs.
Benchmark: https://github.com/kui/png-parse-benchmark
Result:
Note: It is slower than pngjs when devtool is opened.
But I'll not use this rust wasm. Code maintenance with wasm is harder than the current code. I think this benchmark result is not worth it.
Same PC but the latest Chrome (126)
At A18 (or later A17?),
splat3.png
is completely transparent image. So we require to drop the alpha values ofsplat3.png
on web browsers.But the processing takes match time because the image is parsed with pure javascript.
We need to know about browser API (around File API? ImageBitmap? or Canvas?).