

Processing ported to JavaScript - tzury
http://ejohn.org/blog/processingjs/

======
Raphael
Long live the king of JavaScript.

------
bootload
_"... Processing ported to JavaScript ..."_

My project just got a lot more interesting. One of the things I was having
trouble with is generating an image from data with severe constraints on
modules & processing time. Processing.js fills the gap of PIL which I couldn't
use. I'm finding more and more interesting JS modules. Take this one for
instance ~ <http://www.nihilogic.dk/labs/canvas2image/> Converts the canvas to
a binary image.

~~~
bootload
_"... Converts the canvas to a binary image ..."_

Just realised that in fox3 right mouse click on the canvas allows you to save
the image as a .png

~~~
llimllib
You can also save an image via the toDataUrl method of a canvas object:
<http://www.whatwg.org/specs/web-apps/current-work/#todataurl>

------
andreyf
More canvas goodness:

<http://www.abrahamjoffe.com.au/ben/canvascape/>

~~~
llimllib
add the textures and watch your browser slowwwww

~~~
boucher
Not if you're using Safari!

------
dhotson
This is pretty sweet, I've been a big fan of Processing for ages.

Processing reminds me of what was great about languages like QBasic. You could
draw graphics on the screen and animate them without needing to understand how
to use complicated graphics libraries.

It doesn't necessarily need to be fast, it just needs to be easy and fast-
enough!

------
programnature
Needless to say this is very cool.

Could someone explain the technical advantages of having it in javascript
rather than as a java applet?

Obviously java applets are a pain, but at least right now they much more
widely supported than the canvas element.

~~~
jeresig
In my testing the JavaScript version had a better "boot time" (it was able to
begin showing results instantly) - and rendered better/faster for simple
examples. However, the Java Applets simply scale better. They can handle
pretty much anything you throw at them. If you're just tackling simple stuff
(pretty much anything that I demoed on the site) then Processing/Canvas is
probably the way to go.

------
gibsonf1
Wow, I'd love to use this to generate dynamic graphs with text - but does it
support text?

~~~
llimllib
Canvas itself does not support text; there are various hacks to, e.g., port PS
fonts to canvas, but it's a really ugly scene. Other methods include
overlaying HTML text via CSS and server-side image rendering fonts. It's all
really ugly.

~~~
jeresig
Firefox 3 supports native text rendering. There's a couple demos that show
this (although you're out in the cold in other browsers, for now at least).

~~~
gravity
Is there any word on whether other browsers will be implementing this in the
future? It's what's keeping me from using canvas today, and partially what's
keeping me from writing a certain app I've been thinking about for a little
while.

~~~
andreyf
_partially what's keeping me from writing a certain app I've been thinking
about for a little while_

Have you played with SVG?

~~~
llimllib
In my experience it's painfully slow and advanced features are spottily
supported on every implementation I've tried; is yours different?

~~~
jsrn
I've tested some of my SVG demos with FF 3 and they run much faster than with
FF 2 (I think that's due to Cairo being integrated into Firefox 3). Opera and
Safari are very fast compared to FF 2, too.

As for feature completeness I agree with you. The Firefox SVG team is very
small and not funded by the Mozilla corporation (at least that was the case
last year when I talked to one of its members) - the SVG standard, on the
other hand, is _HUGE_.

------
tectonic
Wow, I'm very impressed. Looking forward to playing with this.

------
justinbmeyer
Why not make a JavaScript API instead of Processing?

------
pkrumins
A-M-A-Z-I-N-G

