Menu

What WebAssembly Changes About Browser-Local Image Compression
📰

What WebAssembly Changes About Browser-Local Image Compression

DEV Community: javascript·sandy xu·18 days ago
#OHoSV3eA
#devtojavascript#devto#dev#wasm#memory
Reading 0:00
15s threshold

A browser can run a mature image encoder without sending the image to a server. WebAssembly makes that practical by letting developers compile existing native libraries for the browser. The interesting engineering decisions come afterward: how bytes reach the encoder, which thread does the work, and how much memory remains available.

What runs, and where

WebAssembly, usually shortened to Wasm, is a portable binary compilation target. Languages including C, C++, and Rust can produce modules that a browser engine validates, compiles, and executes. JavaScript typically handles the surrounding application: file selection, interface updates, network requests, and downloads. Wasm handles a bounded piece of computation. MDN's concepts guide explains this relationship and the module's main building blocks.

A module exposes functions through exports and receives capabilities through imports. Its linear memory is a contiguous, byte-addressable region.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.