TotallyNotChase / glitch-this

:camera: Glitchify images and GIF - with highly customizable options!
MIT License
1.76k stars 63 forks source link

Create web api wrapper exposing the library functionalities #11

Closed TotallyNotChase closed 4 years ago

TotallyNotChase commented 4 years ago

A fair number of people want this to be accessed through a webapi, so non-devs can have fun too. I'm totally in on that, I'd have already made one if I owned a domain.

But if anyone would like to implement a web api, go for it! The library should be of help, when you're done, I can link the api in the README

You can do it in your own repo (I'd really appreciate it if it was open source, free, and easy to use) and ask me anything if you need help!

geek-at commented 4 years ago

I'm thinking of including it as a filter on PictShare so it can be accessed as an API

pahefu commented 4 years ago

I didnt make one API, but ported the library methods to pure Javascript (no libs, just canvas) in the browser, plus made a live example on applying it on every frame from a HTML5 video while it's being played.

I guess it could be used in NodeJS too with some tweaks, for those who like to server pages/apis that way.

Not really sure on having ported the numpy code in a 100% true fashion but.. works for a first demo :P.

Repo link.

Linked back to this repo, hope's all ok.

TotallyNotChase commented 4 years ago

@pahefu Awesome! Will link your repo on README!

Also, could you add normal image support as well, right now you can only glitch videos on the demo.

pahefu commented 4 years ago

Yeah, It works with images too (as long as you pass a Canvas pixel array data, the procedure is the same for the "library" part), so will just need to add the UI options on the demo html page.

pahefu commented 4 years ago

Updated the repo demo with the image-only processing.

Also now you can download a glitched image/frame in their original size, which makes this as close as possible to original lib, on the browser. Canvas resizing from css made right-click download scaled to the screen resolution.