{"id":13529903,"url":"https://github.com/transitive-bullshit/gif-extract-frames","last_synced_at":"2025-10-19T14:46:55.177Z","repository":{"id":57250988,"uuid":"132033533","full_name":"transitive-bullshit/gif-extract-frames","owner":"transitive-bullshit","description":"Extracts frames from a GIF including inter-frame coalescing.","archived":false,"fork":false,"pushed_at":"2020-07-11T23:15:06.000Z","size":7031,"stargazers_count":32,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T07:45:10.776Z","etag":null,"topics":["coalesce","coalescing","extract-frames","gif","gif-animation","gifsicle"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transitive-bullshit.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-03T18:17:34.000Z","updated_at":"2025-03-05T05:12:49.000Z","dependencies_parsed_at":"2022-08-24T16:52:12.352Z","dependency_job_id":null,"html_url":"https://github.com/transitive-bullshit/gif-extract-frames","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fgif-extract-frames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fgif-extract-frames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fgif-extract-frames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transitive-bullshit%2Fgif-extract-frames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transitive-bullshit","download_url":"https://codeload.github.com/transitive-bullshit/gif-extract-frames/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250758080,"owners_count":21482348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coalesce","coalescing","extract-frames","gif","gif-animation","gifsicle"],"created_at":"2024-08-01T07:00:40.495Z","updated_at":"2025-10-19T14:46:50.140Z","avatar_url":"https://github.com/transitive-bullshit.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# gif-extract-frames\n\n\u003e Extracts frames from GIFs including inter-frame coalescing.\n\n[![NPM](https://img.shields.io/npm/v/gif-extract-frames.svg)](https://www.npmjs.com/package/gif-extract-frames) [![Build Status](https://travis-ci.com/transitive-bullshit/gif-extract-frames.svg?branch=master)](https://travis-ci.com/transitive-bullshit/gif-extract-frames) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\n## Why?\n\nSome GIFs store delta information between frames instead of storing complete frames. Here's an example:\n\n---\n\nOriginal gif ([source](https://giphy.com/gifs/ycagKBYEmaili)).\n\n![Input gif bubbles](https://raw.githubusercontent.com/transitive-bullshit/gif-extract-frames/master/media/bubbles.gif)\n\n---\n\n5 extracted frames **without** coalescing.\n\n![Example without coalescing](https://raw.githubusercontent.com/transitive-bullshit/gif-extract-frames/master/media/example-without-coalescing.png)\n\n---\n\n5 extracted frames **with** coalescing.\n\n![Example without coalescing](https://raw.githubusercontent.com/transitive-bullshit/gif-extract-frames/master/media/example-with-coalescing.png)\n\n---\n\n## Install\n\nThis module requires `node \u003e= 8`.\n\n```bash\nnpm install --save gif-extract-frames\n```\n\n## Usage\n\n```js\nconst extractFrames = require('gif-extract-frames')\n\nconst results = await extractFrames({\n  input: './media/bubbles.gif',\n  output: 'frame-%d.png'\n})\nconsole.log('number of frames', results.shape[0])\n```\n\n\n## API\n\n### extractFrames(opts)\n\nReturns: `Promise\u003cndarray\u003e`\n\nReturns a modified version of the [ndarray](https://github.com/scijs/ndarray) returned by [get-pixels](https://github.com/scijs/get-pixels).\n\n#### opts.input\n\nType: `String`\n**Required**\n\nPath to a GIF file.\n\n#### opts.output\n\nType: `String`\nExample: `'output/frame-%d.png'`\n\nOptional frame pattern if you want to write each frame to disk. Should contain a `%d` that will be replaced with the frame number (starting at 0).\n\nThe resulting [ndarray](https://github.com/scijs/ndarray) will be returned whether or not an `output` is given.\n\n#### opts.coalesce\n\nType: `Boolean`\nDefault: `true`\n\nWhether or not to perform inter-frame coalescing.\n\n\n## Related\n\n- [gifsicle](https://github.com/kohler/gifsicle) - GIF manipulation library capable of *exploding* gifs, but AFAIK does not support frame coalescing when exporting frames.\n- [gif-explode](https://github.com/hughsk/gif-explode) - Alternative which uses [gifsicle](https://github.com/kohler/gifsicle) but does not support frame coalescing.\n- [omggif](https://github.com/deanm/omggif) - JavaScript GIF encoder \u0026 decoder used under the hood.\n- [ffmpeg-extract-frames](https://github.com/transitive-bullshit/ffmpeg-extract-frames) - Analogous module for extracting frames from video files.\n\n\n## License\n\nMIT © [Travis Fischer](https://github.com/transitive-bullshit)\n\nSupport my OSS work by \u003ca href=\"https://twitter.com/transitive_bs\"\u003efollowing me on twitter \u003cimg src=\"https://storage.googleapis.com/saasify-assets/twitter-logo.svg\" alt=\"twitter\" height=\"24px\" align=\"center\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fgif-extract-frames","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransitive-bullshit%2Fgif-extract-frames","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransitive-bullshit%2Fgif-extract-frames/lists"}