Skip to content

6.0.0

Compare
Choose a tag to compare
@bhj bhj released this 20 Feb 00:24

v6 is a major change making the library significantly smaller and more flexible. Please see the README for updated example usage.

  • Instead of drawing to a canvas, render() now simply returns an ImageData object along with some metadata. This gives full control over your canvas (if a canvas is used at all!)
  • The onBackgroundChange callback is removed; instead, check the backgroundRGBA metadata provided with each rendered frame
  • The setOptions() method is removed, as options are now arguments to render()
  • When loading a file, you now only need to pass the ArrayBuffer of the response (the creation of the new Uint8Array is handled internally)

Improved:

  • Instructions are now processed JIT, significantly reducing load() time
  • Added contentBounds metadata describing a bounding box that fits the rendered frame's non-transparent content