Show HN: PureJsImage, image codecs and scientific raster I/O in TypeScript
purejsimage.comHi HN, I started PureJsImage because JavaScript image processing often means using a native addon, a large WebAssembly payload, a browser-only API, or a full source-sized RGBA bitmap. I wanted a portable TypeScript implementation that works in Node.js, browsers, workers, and serverless functions with zero runtime dependencies by default.
Right now the project has many more decoders than encoders. It includes first-party image codecs, TIFF and BigTIFF, scientific raster readers, whole-slide access, and geospatial support for GeoTIFF, COG, and GeoZarr. The encoder side is still much smaller, so feedback on which output formats matter most would be useful.
The main goals are portability, performance, bounded memory use, and reducing supply-chain risk in controlled or tightly reviewed environments. Optional JPEG and PNG WebAssembly accelerators exist, but they are separate explicit imports and are never loaded by the default package.
Some runnable demos:
- Browser viewer and converter: https://purejsimage.com/demo/ - Scientific raster explorer: https://purejsimage.com/scientific/ - OME-Zarr viewer: https://purejsimage.com/ome-zarr/ - Aperio whole-slide viewer: https://purejsimage.com/wsi/ - COG and GeoZarr range demo: https://purejsimage.com/geo/
One of the more interesting constraints has been memory use. Common baseline JPEG resize paths use bounded MCU rows, remote TIFF and COG access reads selected ranges and regions, and the scientific APIs keep native numeric samples separate from display pixels. Some codecs and format subsets still require explicit full-frame fallbacks, and I try to document those boundaries instead of hiding them.
The project is still young, and I would really value feedback on the API, missing formats, decoder and encoder priorities, adversarial files, browser workflows, and useful performance or memory benchmarks.
Source: https://github.com/a-r-d/PureJsImage
Format support: https://purejsimage.com/codecs/
Scientific format support: https://purejsimage.com/scientific-formats/