Giter VIP home page Giter VIP logo

primitive.js's Introduction

primitive.js

A JavaScript re-creation of the primitive.lol application.

How does it look?

Check out the Masterpieces gallery for several cool samples. There is also a dedicated Electron-based port that works as a regular desktop application.

Try it now!

At a dedicated demo page

Building

Written in client-side JavaScript, uses Rollup for JS bundling and LESS for CSS pre-processing.

  1. git clone [email protected]:ondras/primitive.js.git && cd primitive.js
  2. npm install
  3. npm start

About the algorithm

Most of the ideas are shared with the original app, described at https://github.com/fogleman/primitive/. Rasterization is done via HTML5 , which is very flexible but prohibits reasonable parallelization. Web Worker support is available but not used at all, as it does not currently bring any performance improvement. This might change in the future.

License

MIT

Contributing

There are no major missing features nor a roadmap. The UI needs some polishing w.r.t. UX. If you think your feature/bugfix/contribution might be worthwhile, please ask before diving into the code. Performance improvements (measurable) are welcome.

primitive.js's People

Contributors

coliff avatar darlanmendonca avatar ondras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

primitive.js's Issues

design

in contributing you mention the needed of a design

I'm not a designer. But I can try :D. I have a little

If you like, I can do a design on sketch to planing importants things that you want on your site.

And of course, begin from a reference.
I suggest use the https://primitive.lol/, or other that you like.

let me know what you want, and we can discourse better with a layout on sketch :D

Drawing Mode

Does primitive.js currently support Drawing Mode or, if not, are you planning to add support for it in the future? Thanks!

Documentation

Amazing project man!! I loved

How you wish make the documentation? In a simple Readme.md or in the gh-page?

watchs

one suggestion to improve the work

actually you have use of rollup to bundle script, and lessc to compile styles. but this run only when dev run the scripts js and css or use watch, but this watch only scripts, not styles, or markup (html).

my suggestion is use a local server, to access the index.html on browser, on a localhost, and watch html, css, js, and auto refresh the browser on changes occur.

I suggest browser-sync to this, their works with socket.io to auto refresh, and their is just a express.js server :D

what you think?

GIF generation

Make it output a gif to share with friends. That gif'd show how the computer "solved" that problem, but faster than it was.

Additional parameters in original Go code?

Hey, could you give me a hint as to where to find your additional paramters in the original code? I am looking for these:

Stop shape optimization after 30 failures
Start every iteration with 200 random shapes

I cannot find them in the go code, they seem to be constant numbers somewhere. Would be glad for a hint. Thanks!

Suggestion

Hi,

some weeks ago I found out about primitive.js and I pretty much liked it.

I created an album on my gallery that contains some of my photos redrawn with primitive.js
It would be great if you could add a link to your project.

The link to the album is
https://cielitolindo.de/albums/masterpieces/

Greetings
Cielito Lindo Productions

How to use on server-side?

Hello. Is there an option to use this package on Node backend?
It is not available on npm, right? If so, why?

Using an arbitrary SVG element as a 'shape'.

Hey there. I was hoping you could maybe offer up some insight on how I could go about using an arbitrary SVG element or path as a shape. I spent some time looking at how the different shapes are constructed but haven't been able to figure it out.

I thought I might be able to ctx.drawImage() a base64 representation of a SVG using a Rectangle Polygon but haven't been able to make it work.

Contributing

About contributing, what you wish do with project?

License
Contribute guide
...

I want contribute :D
Amazing project !!

Implement as build step

Would it be hard/possible to convert this to a command line script that could be run in Node? I'd like to use it as a build step in Gulp/Webpack to create SVG placeholders.

I'd like to help if possible, but not sure where to start.

post scripts in npm

I suggest use npm post scripts, to turn more easy run scripts.

Instead write this in readme.md

Written in client-side JavaScript, uses Rollup for JS bundling and LESS for CSS pre-processing

  1. git clone [email protected]:ondras/primitive.js.git
  2. npm install
  3. npm run css
  4. npm run js

I suggest

Written in client-side JavaScript, uses Rollup for JS bundling and LESS for CSS pre-processing

  1. git clone [email protected]:ondras/primitive.js.git
  2. npm install
  3. npm start

What you think?
If you like, I do a PR

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.