Skip to content

animation support for IIP #6126

Description

@jerch

IIP supports the following image formats: PNG, JPEG, GIF, QOI (and new WEBP, AVIF)

Of these formats GIF, PNG, WEBP and AVIF may contain multiple frames for animations. QOI does not know about animations, also JPEG does not support animations (although there exists an M-JPEG derivate).

To support animations from those formats, several obstacles in xterm.js have to be dealt with:

getting the animation frames
This is already a big bummer, as there is no convenient API standardized yet. There is a draft of ImageDecoder in the making, but we cannot rely on that until it gets stable. Also it gives frame access promisified and as a full video frame, not to partial subframes. Both works against xterm.js logic, where a rAF should be sync code and the RAM is precious. So maybe it will never be useable for xterm.js.

Alternatively we can do things manually with custom format parsers:

  • GIF is relatively easy to handle (see omggif)
  • APNG can be done with a simple frame trick and letting the browser do the heavy lifting (apng-js)
  • WEBP and AVIF are on a different scale and most likely too heavy for JS/wasm lifting

image addon storage
Animation frames create a big memory pressure on the addon storage. Additionally the frame metainfo needs to be preserved (offsets, dimensions, composition type, delay etc).

render logic issues
Image rendering is currently passive, thus an image portion gets only updated from an onRender event from xterm.js itself. With animation support we need a self contained render cycle.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions