Blitting pixels
zCanvas is a lightweight JavaScript library that provides a solution for working with HTML Canvas "drawables" as if they were tangible / interactive, separate objects.
Where the children in an HTMLElements "display list" are nicely visible as stacked separate tags, the pixels on a canvas-element remain out of bounds. zCanvas provides a means to work with a similarly stacked display list, adds interaction events to individual objects and supplies utilities allowing interactions such as drag and drop, while supporting constrained movement and collision detection.
zCanvas provides an API that takes care of all animation and update logic you'd associate with, for instance, a game loop. Similarly it allows you to render content (with visual bounds) checking out of the box, including spritesheet animation.
However, the rendering logic (i.e. the "drawing" of the visual content) can be as low level as you'd like, by drawing straight onto the canvas using the browsers CanvasRenderingContext2D-API (though through an abstraction layer which takes care of all transformations).
Tweaked for performance
zCanvas can render content using OffscreenCanvas inside a Web Worker. This basically means that your main execution thread is completely free for your application logic where rendering is delegated to a separate execution stack.
By default, zCanvas adapts to the framerate of the environment (usually 60 or 120 fps) but also supports custom frame rates where movement speed maintains its relative duration.
What are some use cases?
zCanvas is good for 2D animations and is mobile friendly as it is optimized for squeezing the most out of your CPU, relying on optimal use of resources and working well with touch events; as such zCanvas can be an excellent engine for creating mobile web games.
It is also very lightweight and fits within a mere 15 Kb (gZipped).
And some example usages ?
Game wise, you can play Weltkriegsimulator, a mobile friendly, vertical scrolling shoot 'em up or Drunk Dragon vs. the Drag Queens which is a classic style RPG. Both are built on top of zCanvas and are also open source.
For more graphics crunching, you can also use BitMappery, an online image editor.
Available via npm
npm install zcanvas
zCanvas has been written in vanilla (Java/Type)Script and thus works independent from (and should work with) any other JavaScript framework.