Question: Is there a javascript library to draw images directly in the browser and save them to png or jpeg?

I want to use an alternative to services like aviary.com, pixlr.com and sumopaint.com and dont want to rely on third-party services and apis like these ones.

Is processingjs the right solution? I want a solution that works everywhere so please no nodejs and so on.

I need tools like a brush, paintbrush, pencil, layers, filters and so on - just like the real photoshop.

Answer: 
You're extending the `Class` class, and all of your classes, like `Person`, are instances of `Class` (Yes, classes are instances of the `Class` class. They're ordinary objects).

So when you call `Person.add_accessor`, you're calling the instance method `Class#add_accessor`.
because Person (with capital P ) is an instance of the class Class.