Comparisons

How Oxidized Image compares to other image optimization solutions

Sharp

Oxidized Image uses @napi-rs/image as its underlying image processing engine — a Rust-based library offering high-performance image encoding and transformation. The following benchmarks compare its performance against Sharp, the most widely-used Node.js image processing library.

For the full benchmark methodology and source code, see the @napi-rs/image repository.

Benchmark Results

ConfigurationFormatNAPI Image PerformanceSharp PerformanceNAPI Speedup
DEFAULT (baseline)WEBP202 ops/s169 ops/s1.20x
DEFAULT (baseline)AVIF26 ops/s24 ops/s1.08x
UV_THREADPOOL_SIZE=10 (fastest)WEBP431 ops/s238 ops/s1.81x
UV_THREADPOOL_SIZE=10 (fastest)AVIF36 ops/s32 ops/s1.13x

Key Takeaways

  • Peak Speedup: Up to 1.8x faster than Sharp at WebP encoding.
  • WebP: The performance advantage is most pronounced with WebP, particularly when increasing the thread pool size via UV_THREADPOOL_SIZE=10.
  • AVIF: Both libraries perform at near-parity for AVIF encoding, with a modest improvement under default conditions.
  • Test Environment: Apple M1 Max · macOS 12.3.1 · Node.js (node bench/bench.mjs).

On this page