{"id":15834035,"url":"https://github.com/kaelzhang/node-gifx","last_synced_at":"2026-05-14T23:13:35.685Z","repository":{"id":57145087,"uuid":"113978849","full_name":"kaelzhang/node-gifx","owner":"kaelzhang","description":"🔥 A native node.js bindings to the giflib, and provides useful APIs.","archived":false,"fork":false,"pushed_at":"2017-12-14T03:08:44.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T13:16:17.606Z","etag":null,"topics":["bindings","giflib","image","image-processing","nodejs"],"latest_commit_sha":null,"homepage":"","language":"C","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/kaelzhang.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":"2017-12-12T10:53:06.000Z","updated_at":"2017-12-12T14:02:10.000Z","dependencies_parsed_at":"2022-08-22T17:40:32.393Z","dependency_job_id":null,"html_url":"https://github.com/kaelzhang/node-gifx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnode-gifx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnode-gifx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnode-gifx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Fnode-gifx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/node-gifx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246638158,"owners_count":20809753,"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":["bindings","giflib","image","image-processing","nodejs"],"created_at":"2024-10-05T14:00:40.878Z","updated_at":"2025-10-07T23:35:26.669Z","avatar_url":"https://github.com/kaelzhang.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gifx\r\n\r\nCURRENTLY STILL WORKING IN PROGRESS, DO NOT USE.\r\n\r\nThe GIF maker, reader and mangler, which is a native node.js bindings to the giflib.\r\n\r\n## install\r\n\r\n```sh\r\n$ npm i gifx\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nimport Gifx from 'gifx'\r\n\r\nconst catBuffer = fs.readFileSync(filepathCat)\r\nconst dogBuffer = fs.readFileSync(filepathDog)\r\n\r\n// Creates a new 300x200(square pixels) stage\r\nnew Gifx(300, 200)\r\n\r\n.background('#ffffff')  // Sets the background color to '#ffffff',\r\n                        // default to transparent)\r\n\r\n.unit(500)              // Sets the unit time to 500 ms,\r\n                        // i.e. each frame will last 500 ms\r\n.layer()                      \r\n  .start(0)             // Starts from the first frame.\r\n                        // The index of a frame begins with 0.\r\n\r\n  .duration(2)          // The duration is 1 second\r\n  .add(catBuffer)       // Adds a cat\r\n  .leave()              // Returns to the stage\r\n.layer()\r\n  .start(2)\r\n  .end(5)               // Ends before (and NOT INCLUDES) the frame of\r\n                        // index 5 (the fifth frame)\r\n                        // which has the same effect with `.duration(3)`\r\n\r\n  .add(dogBuffer, {     // Adds a dog with a x-axis offset of 150\r\n    x: 150,\r\n    y: 0\r\n  })\r\n  .leave()\r\n.repeat(0)              // Repeat infinitely\r\n.stream()               // Creates a readable stream and write to file.\r\n.pipe(fs.createWriteStream('cat-and-dog.gif'))\r\n```\r\n\r\n# new Gifx(width, height)\r\n\r\n## gif.unit(milliseconds = 1)\r\n\r\n- **milliseconds** `number=1`\r\n\r\nReturns `this`\r\n\r\n## gif.layer()\r\n\r\nReturns `Layer`\r\n\r\n## gif.repeat(repeat)\r\n\r\n- **repeat** `number | boolean`\r\n  - `0 | true`: infinite loop\r\n  - `1 | false`: no repeat\r\n  - other number, `3` for example: plays 3 times\r\n\r\nReturns `gif`\r\n\r\n## gif.stream()\r\n\r\nReturns `Stream.Readable`\r\n\r\n# Layer\r\n\r\n## layer.start(start)\r\n\r\n- **start** `number` the\r\n\r\n## layer.duration(duration)\r\n\r\n## layer.end(end)\r\n\r\n## layer.leave()\r\n\r\nReturns `Gifx`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fnode-gifx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Fnode-gifx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Fnode-gifx/lists"}