spark.js enables faster transmission and better visual quality with extremely fast GPU optimized transcoding. It allows you to use the same image formats and compression workflows across both 2D and 3D content without the need for specialized file formats or separate content pipelines for 3D assets.
Modern image formats like WebP, AVIF and JXL provide excellent quality across a wide range of compression ratios, making them ideal for storage and transmission. In contrast, native GPU formats offer compact in-memory representations but compress poorly. While rate-distortion optimization (RDO) can help, the quality of RDO-based encoders degrades significantly at lower bitrates.
The chart above compares the SSIMULACRA2 score of multiple encoders at various bit rates. Higher values indicate better visual quality. Bit rate (and thus file size) decreases toward the left.
With spark.js you can use modern image formats for storage and delivery, then transcode them at runtime to the most efficient GPU-native format supported by the device. This is literally free bandwidth!
Transcoding to native GPU formats is critical for performance. These formats use 75% less memory than decompressed image formats, which reduces memory usage, increases efficiency, and lowers power consumption.
You can find the source code on the spark.js GitHub repository and install the package via npm: npm install @ludicon/spark.js
Examples
The following examples are all encoded targeting a SSIMULACRA2 score of 80, which is generally considered very high quality (distortion not noticeable by an average observer under normal viewing conditions).
The image on the left is the decoded output and the right is the SSIMULACRA2 distortion map which shows the perceptual error distribution.
OodleTex 1.9.12 at the highest effort level and Kraken compression at level Normal.
Basis 1.6.0 in uastc mode at default quality level and zstd 1.4.9 at level 22 (highest).
spark.js is not limited to raster image formats. It can also be used for vector graphics, which provide a compact representation independent of scale.
SVG + Spark (BC7): 70K
Browser Compatibility
spark.js requires a browser with WebGPU support and a compatible GPU driver. WebGPU is supported in most modern Chromium-based browsers and is gradually being adopted elsewhere.
The spark.js codecs work reliably across all WebGPU-enabled browsers and devices we've tested. However, some browsers have issues with other functionality in the spark.js API. The table below summarizes current support:
To test compatibility in your browser, visit the spark.js⚡️ viewer. If the page fails to load or shows a WebGPU error, your browser may not yet support the required features.
Licensing
Whether you’re building a hobby project or a commercial product, spark.js offers simple and affordable licensing.
It’s free for non-commercial use, and commercial licenses come with low one-time fees and
lifetime distribution rights.
The table below summarizes the available license tiers:
License Level
Non-commercial
Indie
Pro
Development Budget
---
Under $1M
Over $1M
Fee
Free
$1,000
$10,000
Distribution rights
Lifetime
Lifetime
Lifetime
Support
No
No
1 year
Optional
Attribution Waiver
No
No
$5,000
Yearly Support
$2,000
$2,000
$5,000
Licenses are granted per project and include lifetime rights to distribute the spark.js runtime and codecs, with no royalties or ongoing fees.
If you’re unsure which license applies to your project or if you’d like to discuss custom terms,
get in touch.
Commercial use involves any form of monetization through direct sale, donation or promotion of a product using spark.js, and also 'internal use' where spark.js is used in a commercial setting by a business or organization.
The development budget refers to the total estimated cost of creating your web-based product at the time it is released or made publicly available. This includes expenses such as salaries, contractor fees, operational costs, licensing fees, and hardware or software purchases.
We ask that your Product visibly includes the following message:
This attribution must include a hyperlink to https://ludicon.com/sparkjs and be visible to end users of your Product.
Pro users with a commercial license may waive this attribution requirement by purchasing an attribution waiver for an additional fee of $5,000.
Community Support:
Free for all users via the GitHub forums.
Commercial Support:
Available for purchase by Free, Indie, and Pro users.
Includes email support at support@ludicon.com with a guaranteed response within 3 business days.
Also includes early access to beta builds and targeted fixes for your use case.
Developers who require personalized support or additional features are encouraged to obtain a full Spark license. This includes:
Priority email support.
Private Slack channel access.
Custom performance analysis of your application.
One phone or video call per quarter.
Availability for in-person meetings at industry events.
Influence over the roadmap and priority consideration for feature requests.
Yes, all licenses include perpetual access to version updates.
Update frequency and content are not guaranteed and are determined solely by Ludicon.
To stay in touch with us and receive Spark development updates, consider subscribing to our newsletter: