jsgif | HTML5 Canvas to GIF and Animations | Animation library

 by   antimatter15 JavaScript Version: Current License: MIT

kandi X-RAY | jsgif Summary

kandi X-RAY | jsgif Summary

jsgif is a JavaScript library typically used in User Interface, Animation applications. jsgif has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Based on [as3gif] Ported by [Kevin Kwok] ![This is the raw canvas element saved as a non-animated PNG] Demos/raw_canvas.png) ![This is the GIF which was generated from the canvas.] Demos/converted_animation.gif) ![This is the GIF which was generated from the canvas.] Demos/clock.gif). Since web pages can usually natively play GIFs fine, it’s only a port of the GIFEncoder portions of the library.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jsgif has a medium active ecosystem.
              It has 1039 star(s) with 143 fork(s). There are 40 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 14 open issues and 9 have been closed. On average issues are closed in 79 days. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of jsgif is current.

            kandi-Quality Quality

              jsgif has 0 bugs and 0 code smells.

            kandi-Security Security

              jsgif has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              jsgif code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              jsgif is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              jsgif releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              jsgif saves you 642 person hours of effort in developing the same functionality from scratch.
              It has 1492 lines of code, 42 functions and 25 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed jsgif and discovered the below as its top functions. This is intended to give you an instant insight into jsgif implemented functionality, and help decide if they suit your requirements.
            • Create a tween
            • convert to string
            • identify the DOM element
            • determine the animation type
            • Returns the window size
            • {{{ 1 encode
            • merge two objects
            • Creates a new CookieTreeTree object .
            • Check if a given variable exists .
            • Find index of element in array .
            Get all kandi verified functions for this library.

            jsgif Key Features

            No Key Features are available at this moment for jsgif.

            jsgif Examples and Code Snippets

            No Code Snippets are available at this moment for jsgif.

            Community Discussions

            QUESTION

            how to convert frames of GIF into spritesheet
            Asked 2021-Aug-02 at 10:25

            I am trying to merge multiple frames from a GIF to convert them into spritesheet. I am somehow able to extract frames using libgif.js here is my code. The Canvas in which i want to put all my images is empty and is at the end i dont know what is wrong with it.

            ...

            ANSWER

            Answered 2021-Aug-02 at 10:25

            The main issue in your solution is that you are looping through all inserted frame-images and using window.onload with the expectation to draw images on the canvas. However, you are assigning windows.onload on the image elements after the images have already been attached to the dom in the previous (for i = 0) iteration, through $("#frames").append(.... This means that your onload handlers are getting registered after the event has already fired.

            I rearranged your code into the snippet below to make sure that onload is registered before appending the image-frames into the document.

            In this solution here I created the "spritesheet" by putting the image-frames vertically one-after-the-other. Tweak the solution accordingly to create your desired "spritesheet layout".

            The tricky part is that you need to set a width and height for the canvas in a dynamic fashion, which means you have to wait for all image-frames to be loaded into the document and meassure their collective widths and heights. The algorithm should be:

            1. Collect all widths and heights of image-frames onload
            2. Calculate the total canvas.width and canvas.height depending on your desired layout (in my vertical-one-ofter-the-other solution this means to use the maximal image width as canvas width and the sum of all image heights as height. If you need a different spritesheet layout then you need to adapt this logic differently)
            3. Draw all the images on the canvas, which by this point has enough width and height to fit all your gif-frame-images.

            In my solution I did not implement this algorith, I rather hard-coded the canvas width and height after manually calculating the max-img-width and total-img-height for your particular gif example.

            Source https://stackoverflow.com/questions/68616932

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install jsgif

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/antimatter15/jsgif.git

          • CLI

            gh repo clone antimatter15/jsgif

          • sshUrl

            git@github.com:antimatter15/jsgif.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link