This experiment dates from 2006. I (@c3o) moved on to create
tumblelogging / lifestreaming startup Soup.io.
The CanvasPaint code (messy as it is)
has been released into the public
domain. Information below might be
outdated. Thanks for visiting!
A near pixel-perfect copy of Microsoft Paint
in HTML, CSS and JavaScript, using
the <canvas>
tag as specified by
WHATWG
and supported by Safari 1.3, Firefox 1.5 and Opera 9.
This web app is not authorized by, supported by or in any way affiliated with Microsoft.
The primary goal wasn't to build a painting web app, but to experiment with <canvas>
.
Holding down ctrl for a tertiary color, shift for line/shape constraints, ctrl+a/c/x/z, dragging and resizing the window, resizing the canvas...
Yes, but only in Firefox 2 and Opera 9.
To save an image to your hard drive, use File > Download. To save it on this server,
use File > Save online. Your image will be assigned a URL which you may share or
embed elsewhere, and it may be publically shown here. However, no guarantees are given as to
its future availibity: I reserve the right to delete images at any time.
Allow scripts to disable context menus. To do this in Firefox, check "disable or replace context menus" in Options > JavaScript: Advanced...
Some features are only supported by certain browsers:
<canvas>
useful?
Yes, for applications that do not require cross browser support, such as OS X
desktop widgets or Firefox extensions and XUL apps.
For drawing apps, the biggest problem is that you're limited by the refresh rate of
the mousemove
event to find the position of the cursor. This is especially noticable with
the airbrush tool, while I try to hide it with the pen and brush tools by automatically
smoothing the created path.
Other shortcomings: Gets very slow at large sizes (both actual high resolution and CSS-sized),
no getPixel(), several bugs and missing features in Firefox 1.5.
Interesting features not used here: Transparency.
This demo uses 5 <canvas>
es: the obvious one, one transparently
layered on top for previews while drawing shapes and lines, a hidden one used as
a clipboard for saving selections, another hidden one saving the last undo state,
and the gradient in the title bar.
The cursors make use of another Firefox 1.5 feature:
CSS3 cursor URLs.
Canvascape 3D
Mandelbrot fractals
CanvasGraph
Image reflections
Canvas Painter
Please don't sue me. Kthx.
Christopher Clay (canvas@c3o.org) 2006
Your browser doesn't support the WHATWG <canvas> element.
To try out CanvasPaint, consider downloading
Mozilla Firefox – it's free and secure.