An00nymushun / DiscordFreeEmojis

224 stars 119 forks source link

Image composition? #25

Open marcussacana opened 3 years ago

marcussacana commented 3 years ago

What about use library like this: https://github.com/lukechilds/merge-images To automatically generate a new image when we select multiple emojis... Puting all emojis side-by-side in a single image After that we just need send the genareted image as attachment...

Anyway thank you for the plugin, I really wanted something like that.

An00nymushun commented 3 years ago

It could really bloat up the size of the plugin to do something like that, and gifs wouldn't be supported It is possible, but people usually would want to do this with animated emojis I assume

marcussacana commented 3 years ago

Hmm, Well, that's true, but I think that should help a lot in the flood problem Also, maybe you can just like what you do now, keep 2 versions of the plugin. To the one with composition, to allow use gifs, just disable this feature to animated emojis

marcussacana commented 3 years ago

Another possibility, Only compose the image when select multiple static emojis. To the animated ones we can't do much with this library, then maybe just put links in that case, or just find alternative libraries (that i'm sure we're able to found at least one). Bloat the plugin size isn't a problem at all, isn't like the discord, a chromium app is optimized pfff. also, just like you do currently you can release as a 'special versoin' to who wants, and still release the minimal version of the plugin.

Mattwmaster58 commented 2 years ago

Working with images on the canvas isn't that bad for static images IMO. For gifs, it should be possible (anything is ;)), but to do it all in JS, performantly, would be a huge pain sans other libs (and probably even with other libs). Every example I've seen requires an LFZ decompressor, other stuff, etc

Mattwmaster58 commented 2 years ago

Another thing that would be hard about GIFs would be stringing them together in a way that they all appear coherently. If gif A has 41 frames forming one perfect loop, and gif B has 55 frames forming a perfect loop, and gif C has 13 frames forming a perfect loop, you'll need 29,315 frames to loop it all perfectly. And of course there's heuristics you could take to try and cut the gif at less destructive points, but it would be complicated and janky to do this the "right" way, no matter how you define "right".

Mattwmaster58 commented 2 years ago

I was able to put this together: https://jsfiddle.net/m28djz1c/. Obvisouly extremely jank (images aren't sorted, aren't split up etc), but it works. We could use Uploader.upload to upload the file.

marcussacana commented 2 years ago

Good job @Mattwmaster58