In my current project, I have developed a web application that allows users to upload animated gifs. Through this application, users can place the gifs on the webpage using <img>
tags and move them around as they please. After the user finishes arranging the gifs, the task at hand is to export the result into one gif file that incorporates all the uploaded gifs.
For instance, if a user uploads two animated gifs and positions them side by side on the webpage, I need to merge them into a single gif file where both gifs are displayed together.
One idea I have been contemplating involves extracting the frames from each uploaded gif, combining the frames from each gif into a single frame (e.g., result_frame_1 = gif1_frame_1 + gif2_frame1, result_frame_2 = gif1_frame_2 + gif2_frame2, and so on), and then rearranging these frames to create the new gif.
Because this process needs to be executed using JavaScript, I am seeking libraries that could assist with this task. Essentially, I require a library that can extract frames from a gif, manipulate them, and reconstruct a gif from the modified frames.