top | item 3553793

Show HN: JavaScript Instagram-like Filters

127 points| alexmic | 14 years ago |github.com | reply

27 comments

order
[+] kwamenum86|14 years ago|reply
You should rewrite a "pseudo-non-blocking" implementation of these filters. Right now they block the UI thread for too long, which limits how useful these can be. Web workers in one option, although it's not widely supported. The better option is to use setTimout or setInterval to break of the processing work into chunks, which is supported in all browsers. For example, run the loop n iterations then run the next n after a 15 ms delay. The way you've implemented the processing right now makes this lib unsuitable for use on the clientside.
[+] newhouseb|14 years ago|reply
Additionally, if you were doing this a couple years from now you could do it all in a shader in WebGL - which mimics what I believe to be Instagram's technology progression from pure CPU filters to pure GPU filters.
[+] alexmic|14 years ago|reply
Yeah, I am aware of that. This was literally a weekend thing, so I'll try and improve it when I have some time. Thanks for the feedback!
[+] iso8859-1|14 years ago|reply
Why not use WebWorkers?
[+] hhastings|14 years ago|reply
What a fantastic contribution & thanks for considering MIT/MPL. This will definitely come in handy as a small side side feature for user profiles on my upcoming projects.
[+] huytoan_pc|14 years ago|reply
It's definitely a good start, but IMO the quality of the filters are not on par with those of Instagram.

A better JS filter library I found is CarmanJS. Check out their demos at http://camanjs.com/examples/presets

[+] rokhayakebe|14 years ago|reply
Awesome. I would suggest wrapping this into a small service and sell it as an API. No need for complicated documentation either, one URL with parameters.
[+] franze|14 years ago|reply
really great work there.

not a big fan of the license choice, though.

[+] cleverjake|14 years ago|reply
Not to derail the thread, but whys that?
[+] whymsicalburito|14 years ago|reply
Awesome work! Is there a way that these filtered images could then be saved server side to be used later without the js?
[+] alexmic|14 years ago|reply
You could get the image data from the canvas element using getImageData() and upload it to your server.
[+] leak|14 years ago|reply
This is awesome. Thanks!