GameJs does this and much more - it looks like PyGame mentioned.
http://gamejs.org
The ability to draw polygons (not just rectangles!) With RGBA colors (i.e. partially transparent),
gamejs.draw.polygon (surface, color, pointlist, width)
Transparent colors can be defined as "rgba (50, 50, 50, 0,1)" (the latter is alpha)
http://docs.gamejs.org/gamejs/draw/#polygon
Ability to download bitmap images,
var surface = gamejs.image.load('images/foo.png')
http://docs.gamejs.org/gamejs/image/
Ability to read the current pixel color in a given coordinate.
// a surface array is a special DOM canvas array // that is superfast for per pixel access / manipulation var srfArray = new SurfaceArray(display); srfArray.set(50, 100, [255, 0, 0, 100]); srfArray.get(20, 30);
http://docs.gamejs.org/gamejs/surfacearray/
source share