{"_id":"@bobwombat/canvas-gif","_rev":"1-6a7fd5e177b58d66d51a8c0833620f67","name":"@bobwombat/canvas-gif","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.1":{"name":"@bobwombat/canvas-gif","author":{"name":"newtykins, bobwombat"},"repository":{"type":"git","url":"git+https://github.com/bobwombat/canvas-gif.git"},"description":"Manipulate GIFs easily using node-canvas!","version":"1.0.1","main":"dist/index.js","license":"OQL","scripts":{"build":"gulp"},"dependencies":{"canvas":"^2.8.0","decode-gif":"^1.0.1","gif-encoder-2":"^1.0.5","gm":"^1.23.1"},"devDependencies":{"@types/gm":"1.18.11","@types/node":"16.4.11","dts-minify":"^0.3.0","glob":"^7.2.0","gulp":"^4.0.2","gulp-cli":"^2.3.0","gulp-typescript":"^6.0.0-alpha.1","gulp-uglify":"^3.0.2","ttypescript":"^1.5.13","typescript":"4.3.5"},"keywords":["canvas","gif","encode","decode","node-canvas","image-editing","graphicsmagick","coalesce","editor","frame"],"types":"./dist/index.d.ts","gitHead":"c9ddd1a73c6b25d45f7ed559c81c3ff64aa185b0","bugs":{"url":"https://github.com/bobwombat/canvas-gif/issues"},"homepage":"https://github.com/bobwombat/canvas-gif#readme","_id":"@bobwombat/canvas-gif@1.0.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-JmySYluLVRvX4hKKxpcorWNyVjNGypKPKb4czOxL0HL091JpjJPYLsM/tFd2SO0FLhOO4II7waWQFqG+tR7QuA==","shasum":"7c36b57b51171ddb2b76ce0c5a8150de93837c9c","tarball":"https://registry.npmjs.org/@bobwombat/canvas-gif/-/canvas-gif-1.0.1.tgz","fileCount":5,"unpackedSize":8877,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKc/gODO0vT+FdGYXsKCJHyd8ccNxcN3SEGOT9qnL7nwIgMT1Yi+1930/3CTt0hv+Q8E73frVuq0jpHiSgYxvKA+s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7FszACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhGRAAlbSv03jz/I7/hUDKZq+r6Rz8ovQgi6oraEdMddl9WFS+deGV\r\nU+5oZYUTCm+jGFBeAy/1en5GsXdHaVBqLhf4iZy6kfbH2sJS7LEmy9Wa+Cpv\r\nHhvsiXMhkti8YOVRvCHVyeMCLSw9zgidUAbi20mou2MPNB3HiIwBpxZUG9HE\r\nObR0HfMqK/G1jyJm+FLia0hZXH56fTuTI+hWm2oZV514xlJWlgIhwmPRWFYE\r\nCOksrU+emIlyfSrax1iRId68DjL573OgKIN0gh9/bLlOLo4QgGk9t2ik00HS\r\nx4ZsNrX1gAuqQCY09jm3UNyknLABpiKOfLx/rrwu2h2dbTFG0ygMFiJ9vhgT\r\nEemYjolN9xsBPTe1GSsEFhrVdIZBaQrvsWWW+QpSrAthkPYQcK5wg65706UN\r\npuilbgSJctZUSdqqqYE8tFcqQXgTwIwyY94YJQagmSb6lKtvXIYiLZ7RmrE5\r\n+JB8GeiV0QdiIawq+35LRlaKPxrkQ+jtT+AIyb+4VERCwNd9HYizHc5H08pk\r\njd08nrShZrHZRLW0EH1EboD87n862lRGAJeSCRs+O+eykMtymhbcGZPZxdCq\r\nKrYg/8CWenDJauJ30Rp1lDwW5+qCs7xBK5vMStqaafwDgHq+IcR4myobJ8u2\r\n7+Gpxfn7uMMmrxBL3AGdTTsR3rAqh1MCXZI=\r\n=pYPo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bobwombat","email":"bobmwombat@gmail.com"},"directories":{},"maintainers":[{"name":"bobwombat","email":"bobmwombat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canvas-gif_1.0.1_1659657011207_0.3121768590196683"},"_hasShrinkwrap":false},"1.0.2":{"name":"@bobwombat/canvas-gif","author":{"name":"newtykins, bobwombat"},"repository":{"type":"git","url":"git+https://github.com/bobwombat/canvas-gif.git"},"description":"Manipulate GIFs easily using node-canvas!","version":"1.0.2","main":"dist/index.js","license":"OQL","scripts":{"build":"gulp"},"dependencies":{"canvas":"^2.8.0","decode-gif":"^1.0.1","gif-encoder-2":"^1.0.5","gm":"^1.23.1"},"devDependencies":{"@types/gm":"1.18.11","@types/node":"16.4.11","dts-minify":"^0.3.0","glob":"^7.2.0","gulp":"^4.0.2","gulp-cli":"^2.3.0","gulp-typescript":"^6.0.0-alpha.1","gulp-uglify":"^3.0.2","ttypescript":"^1.5.13","typescript":"4.3.5"},"keywords":["canvas","gif","encode","decode","node-canvas","image-editing","graphicsmagick","coalesce","editor","frame"],"types":"./dist/index.d.ts","gitHead":"57d643467aa7fc99158058218d5f36b73794ab9a","bugs":{"url":"https://github.com/bobwombat/canvas-gif/issues"},"homepage":"https://github.com/bobwombat/canvas-gif#readme","_id":"@bobwombat/canvas-gif@1.0.2","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-NfvQpM3eGT4L7eI+xAcTAICxuAj4CQ/vqmWOMPfowfiDUJauzXqIoYaSESq37hI0ARQSpeAbeS85/El6Ya3c9A==","shasum":"12839053109c467b1f0d2f28c742c6ef572235b3","tarball":"https://registry.npmjs.org/@bobwombat/canvas-gif/-/canvas-gif-1.0.2.tgz","fileCount":5,"unpackedSize":8827,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICNSUt6MDzj1/LuvUiHv0U9fHcvJG94RDR0vbsdMvCFHAiAxjpzPFWKyZaj10lzeQrchSbz79nxaO9UQnVg7sMGfvg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7F9NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdmA/+MJ5NhZIvj+xNF1JtZMzvvCz36X5eaD1GgCRhvE2LBlq7z2MK\r\nbEKl0bACA45HEY/vuLctRKYNrZYChOBG35rx0wySO5zRlF9mQckeojufLBOx\r\nfaJL9Aput393JpN3SlGef/a8+uUKx4g0OSxcyf7eS6GEbVkMqbykBDe2kbNb\r\nUxZdWpjLD3mS3NSSf8BZCAjnHRurUwuy7YYgoW/R7DGqgLQkrvGyUPOmcj9R\r\n1ZT10lYgqzaUA/sF8fp5mNyRiYHv9ueFPqBgEmc1F8D/VhaDSUFeiuse7CEd\r\n5R7wzr3DoC9OEuUw1wBGEssDLO1FOfSTmH3ydRp62EN7LXWf/1DdQnDCW42K\r\ndACQrwmfM2VzjmdFP8QDBQhlUQ2nvMZKmPpBzdltp0MIu35dUg/IRlTAKVYM\r\nw03o7KB60R5FQwp5vZ+d7He03gaSRK8f/ICF4lbiNjuwc0jY4CGnw5lfmTFx\r\nWk4Yj3nDUiysek8in9uTUpCtuFD7ZFwrcIPSfCavNsVJJCCrFzxNreL6CDCJ\r\nfM/FfoREzv9C3JMLyY8zasGooiB2wV2O3et7D2QDkM02qjOyXdj34R7gqi9H\r\ndXU/e0VIjhDZaB7S13/pdxna0zvhIIvkhJYesij7kwh2CGvXlgGxqEBPJ8te\r\ntmuS9YIQpz9CEfFJgeO7oNu9mRZc2WGIJH0=\r\n=4cdV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bobwombat","email":"bobmwombat@gmail.com"},"directories":{},"maintainers":[{"name":"bobwombat","email":"bobmwombat@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canvas-gif_1.0.2_1659658061261_0.5554643833639585"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-04T23:50:11.141Z","1.0.1":"2022-08-04T23:50:11.382Z","modified":"2022-08-05T00:07:41.490Z","1.0.2":"2022-08-05T00:07:41.403Z"},"maintainers":[{"name":"bobwombat","email":"bobmwombat@gmail.com"}],"description":"Manipulate GIFs easily using node-canvas!","homepage":"https://github.com/bobwombat/canvas-gif#readme","keywords":["canvas","gif","encode","decode","node-canvas","image-editing","graphicsmagick","coalesce","editor","frame"],"repository":{"type":"git","url":"git+https://github.com/bobwombat/canvas-gif.git"},"author":{"name":"newtykins, bobwombat"},"bugs":{"url":"https://github.com/bobwombat/canvas-gif/issues"},"license":"OQL","readme":"<div align=\"center\">\r\n    <img src=\"examples/output1.gif\" height=\"250\"><br>\r\n    <h1>canvas-gif</h1>\r\n\t<h3><code>npm i canvas-gif</code></h3> \r\n    <img src=\"https://img.shields.io/bundlephobia/min/canvas-gif?color=red&label=Package%20Size&logo=npm&style=for-the-badge\" alt=\"Package Size\">\r\n    <img src=\"https://img.shields.io/github/package-json/v/newtykins/canvas-gif?color=grey&logo=github&style=for-the-badge\" alt=\"Version\">\r\n</div>\r\n\r\n### What is canvas-gif?\r\n\r\ncanvas-gif is an NPM library that allows you to manipulate the frames of GIFs using [node-canvas](https://github.com/Automattic/node-canvas).\r\n\r\n### How does it work?\r\n\r\nIt works by following these instructions:\r\n\r\n1. Read the input GIF as a [Buffer](https://nodejs.org/api/buffer.html) (optional: coalesce the GIF if the option has been enabled and [graphicsmagick](http://www.graphicsmagick.org) is available)\r\n2. Decode the GIF into [UInt8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)(s)\r\n3. For each frame in the GIF, create a canvas instance\r\n4. Transform the UInt8Array into canvas image data and put it onto the context\r\n5. Pass the context and other relevant information to the user defined editFrame function that will continue to manipulate the context.\r\n6. Add the newly edited frame's context to the encoder\r\n7. Output the encoder's data as a Buffer and return it\r\n\r\n### How can I make use of it?\r\n\r\nYou can download it using npm by running\r\n\r\n```\r\nnpm i canvas-gif\r\n```\r\n\r\nAnd you can then proceed to use it in your code. For an example of how to do so, please check out the [example](example) folder.\r\n\r\n### Options\r\n\r\nAll of these options are optional! _wow_\r\n\r\n-   **coalesce** - Whether the GIF should be coalesced by GraphicsMagick before being processed by the engine. Requires GraphicsMagick to be installed - if it is not and the option is true and error will be thrown and the code will continue with the original file buffer. Defaults to **false**\r\n-   **delay** - The amount of delay between each frame in ms. Defaults to **0**\r\n-   **repeat** - How many times the GIF should repeat. If the value is 0, it will repeat forever. Defaults to **0**\r\n-   **algorithm** - The algorithm the encoder should use. Can be one of **neuquant** and **octree**. Defaults to **neuquant**\r\n-   **optimiser** - Whether the encoder should use its in-built optimiser. Defaults to **false**\r\n-   **fps** - The amount of frames to render per second. Defaults to **60**\r\n-   **quality** - The quality of the GIF. A value between 1-100. The higher the number, the better quality the GIF will be. Defaults to **100**\r\n\r\n### Common Errors\r\n\r\n#### There was an error during coalescing: Stream yields empty buffer. Reverting buffer to file buffer!\r\n\r\nThis error happens if the coalescing option is enabled but you are missing GraphicsMagick. Please install it from [here](http://www.graphicsmagick.org/download.html) and if the error persists feel free to report it as a problem and I'll try my best to help!\r\n\r\n<sub>See the code's license <a href=\"license.md\">here.</sub>\r\n\r\n### To-do\r\n\r\n-   Return emitter for easy event handling\r\n","readmeFilename":"readme.md"}