qrohlf / trianglify

Algorithmically generated triangle art
http://qrohlf.com/trianglify/
GNU General Public License v3.0
10.08k stars 669 forks source link

watch files in gulp #20

Closed mandulaj closed 10 years ago

mandulaj commented 10 years ago

Hi! I am working with your awesome library :smile: but it is very tedious to type the gulp command every time I want to see the result. So I am using gulp's watch to do it instead. I think you will like it as well ...

qrohlf commented 10 years ago

Hi! Thanks for the PR.

I'm not going to merge this as-is because this isn't the correct way to add watch functionality using gulp. If you really want to have a watch feature, you should define a watch task containing a gulp.watch directive with the jshint and minify tasks passed in as arguments. See the official example here for the right way to do it.

Also, out of curiosity why are you using the minified source for development? If you use the normal source when developing, you should only have to run gulp before committing.

mandulaj commented 10 years ago

I am trying to speed up the noise rendering by removing some of the options and so I have to tinker with the library a little.... (as it is, it is too slow) And yeah I am aware that this is not the most correct way of watching but it works!! Yet still thanks I will update it ASAP.

qrohlf commented 10 years ago

Right, a few things:

mandulaj commented 10 years ago

I understand that you know far more about this topic then me so I am not going to argue. Yet the thing is that the noise filter is the core of the problem. I understand that the SVG is rendered at the browser so if we reduce the amount of work the browser has to do, the render becomes faster. By experimenting I found, that by decreasing numOctaves to 1, the rendering is much faster (less work done by browser) and the visual difference is negligible.

PS:And yeah, now that I am thinking about it, you are right: Why am I even bothering compiling the source :smile: I guess because of jshint only.

qrohlf commented 10 years ago

Ahhhh. I thought that you were removing options from the Trianglify library itself in an attempt to increase render performance, which would do pretty much nothing. Tweaking the feTurbulence attributes could have a marked improvement on rendering speed - I never really got around to it because I only use noise when pre-rendering images that are then rasterized and hosted statically. Definitely interested in seeing the results there.

approves

mandulaj commented 10 years ago

Thanks :+1: