Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*api/function please* #2

Open
reteps opened this issue May 14, 2018 · 2 comments
Open

*api/function please* #2

reteps opened this issue May 14, 2018 · 2 comments
Milestone

Comments

@reteps
Copy link

reteps commented May 14, 2018

Hi,
I was trying to create a image deep fryer for my group chat, and I was wondering if there was an easy way I can deep fry an image. Would you be willing to either

  1. create an API (hard)
  2. create a function accepting all the values of the meme deep frier and returning the deep fried meme? (yay)
    I can hear the chants already "Thank you! This is awesome"

This is really cool what you did, thanks!

@efskap
Copy link
Owner

efskap commented May 15, 2018

Hey, thanks!
So as far as I can tell, both options would require a rewrite of the program, as it's currently reliant on a <canvas> element to do the actual jpg frying. This is so the app runs entirely in the browser with no backend processing, so I don't have to run a webserver / server function, and is the reason the code is such callback hell.

Tbh I probably won't get around to this anytime soon, but for your bot (if in python) you could easily apply filters with pillow and just repeatedly save/open a jpg in memory to fry.

cheers

@efskap efskap added this to the backlog milestone May 15, 2018
@cAttte
Copy link

cAttte commented Jan 24, 2020

You could use Node Canvas for backend canvas manipulation. Caman is available for Node.js too (if you're having problems installing it). Don't know about glfx as it uses WebGL and Node Canvas doesn't support it currently, so you'll have to research that. I found this CodePen which uses PIXI to bulge/pinch images, and I also found this way of using PIXI with Node Canvas, but it is a little hacky. I also found this SO answer to use the bulge effect, but I don't know how easy it'd be to implement it in JS. Looks like overall the hardest part will be to implement the bulge/pinch effect. I'm making a meme generation API so if I find a way of doing the bulges, I'll tell you :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants