{"id":13573795,"url":"https://github.com/drawcall/inkpaint","last_synced_at":"2025-04-12T22:19:16.955Z","repository":{"id":42053335,"uuid":"399046272","full_name":"drawcall/inkpaint","owner":"drawcall","description":"InkPaint is a lightweight node.js canvas graphics library","archived":false,"fork":false,"pushed_at":"2024-12-19T05:37:52.000Z","size":17579,"stargazers_count":259,"open_issues_count":7,"forks_count":25,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-04T01:28:59.255Z","etag":null,"topics":["node-canvas","node-gl","node-webgl","nodejs-canvas","server-canvas"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drawcall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-23T09:32:22.000Z","updated_at":"2025-03-23T20:53:45.000Z","dependencies_parsed_at":"2024-06-18T18:16:01.227Z","dependency_job_id":"9667bc97-0b7b-4bdc-9a79-acc9e319a7a0","html_url":"https://github.com/drawcall/inkpaint","commit_stats":{"total_commits":38,"total_committers":3,"mean_commits":"12.666666666666666","dds":"0.23684210526315785","last_synced_commit":"b812a58ab1c4c7e4932184668449bbb6b7cce476"},"previous_names":["tnfe/inkpaint"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawcall%2Finkpaint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawcall%2Finkpaint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawcall%2Finkpaint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drawcall%2Finkpaint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drawcall","download_url":"https://codeload.github.com/drawcall/inkpaint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637949,"owners_count":21137577,"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":["node-canvas","node-gl","node-webgl","nodejs-canvas","server-canvas"],"created_at":"2024-08-01T15:00:41.367Z","updated_at":"2025-04-12T22:19:16.916Z","avatar_url":"https://github.com/drawcall.png","language":"JavaScript","readme":"# InkPaint — canvas graphics rendering library for node.js\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./examples/img/logo.png\" /\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://www.npmjs.com/inkpaint\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/inkpaint.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/inkpaint\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/inkpaint.svg\" alt=\"Package License\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/prettier/prettier\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg\" alt=\"Code Style\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/tnfe/inkpaint/pulls\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://nodejs.org\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/node-%3E%3D%208.0.0-brightgreen.svg\" alt=\"Node Version\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## Overview\n\nInkPaint is a lightweight node.js canvas graphics animation library. It forks from the famous canvas engine pixi.js. You can use it to do server-side image synthesis.\n\nInkPaint has a lot of performance optimization and code refactoring. One of its application Demo is FFCreator [https://github.com/tnfe/FFCreator](https://github.com/tnfe/FFCreator) video processing library.\n\nAt the same time, inkpaint is a common library between node.js and the browser, and it can still run normally on the browser side.\n\n## Current features\n\n- WebGL renderer (headless-gl)\n- Canvas renderer (node-canvas)\n- Super easy to use API\n- Support for texture atlases\n- Asset loader / sprite sheet loader\n- Support multiple text effects\n- Various Sprite effects and animations\n- Masking and Filters\n\n## Basic Usage\n\n```sh\nnpm install inkpaint\n```\n\n```js\nconst fs = require(\"fs-extra\");\nconst { Application, Sprite, Ticker, Loader } = require(\"inkpaint\");\n\nconst width = 800;\nconst height = 600;\n\nconst app = new Application(width, height);\nconst loader = new Loader();\nloader.add(\"boy\", \"./assets/boy.png\");\nloader.load(loaded);\n\nfunction loaded(loader, resources) {\n  const boy = new Sprite(resources.boy.texture);\n  boy.x = width / 2;\n  boy.y = height / 2;\n  boy.anchor.set(0.5);\n  app.stage.addChild(boy);\n}\n\nconst ticker = new Ticker();\nticker.start();\nticker.add(() =\u003e {\n  app.render();\n  boy.x += 0.1;\n});\n\n// save image\nconst buffer = app.view.toBuffer(\"image/png\");\nfs.outputFile(\"./hello.png\", buffer);\n```\n\n## Save Image\n\nInkPaint supports saving pictures in multiple formats, you can refer to the api of node-canvas [https://github.com/Automattic/node-canvas#canvastobuffer](). You can save any animated graphics supported by the browser on the server side.\n\n## Installation\n\n### Install `node-canvas` and `headless-gl` dependencies\n\n\u003e ##### If it is a computer with a display device, such as a personal `pc` computer with `windows`, `Mac OSX` system, or a `server` server with a graphics card or display device, you can skip this step without installing this dependency.\n\nIf you are using `Centos`, `Redhat`, `Fedora` system, you can use `yum` to install.\n\n```shell\nsudo yum install gcc-c++ cairo-devel pango-devel libjpeg-turbo-devel giflib-devel\n```\n\nInstall[`Xvfb`](https://linux.die.net/man/1/xvfb) and [`Mesa`](http://www.sztemple.cc/articles/linux%E4%B8%8B%E7%9A%84opengl-mesa%E5%92%8Cglx%E7%AE%80%E4%BB%8B)\n\n```shell\nsudo yum install mesa-dri-drivers Xvfb libXi-devel libXinerama-devel libX11-devel\n```\n\nIf you are using `Debian`, `ubuntu` system, you can use `apt` to install.\n\n```shell\nsudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++\nsudo apt-get install libgl1-mesa-dev xvfb libxi-dev libx11-dev\n```\n\n## Start Up\n\n\u003e If it is a computer with a display device, such as a personal pc computer or a server server with a graphics card or display device, start normally `npm start`\n\n#### Otherwise, You must use the `xvfb-run` script command to start the program to use webgl under the Linux server\n\nxvfb-run more detailed command parameters [http://manpages.ubuntu.com/manpages/xenial/man1/xvfb-run.1.html](http://manpages.ubuntu.com/manpages/xenial/man1/xvfb-run.1.html)\n\n```shell\nxvfb-run -s \"-ac -screen 0 1280x1024x24\" npm start\n```\n\n## How to build\n\nNote that for most users you don't need to build this project. If all you want is to use InkPaint, then\njust download one of our [prebuilt releases](https://github.com/tnfe/inkpaint/releases). Really\nthe only time you should need to build InkPaint is if you are developing it.\n\nIf you don't already have Node.js and NPM, go install them. Then, in the folder where you have cloned\nthe repository, install the build dependencies using npm:\n\n```sh\nnpm install\n```\n\nCompile the node.js package\n\n```sh\nnpm run lib\n```\n\nAt the same time, inkpaint is a common library between node.js and the browser, and it can still run normally on the browser side.\nIf you want to view the example on the browser side, please execute\n\n```sh\nnpm run web\n```\n\nTo execute the example under node.js, execute\n\n```sh\nnpm run examples\n```\n\n### License\n\nThis content is released under the (http://opensource.org/licenses/MIT) MIT License.\n","funding_links":[],"categories":["HarmonyOS","JavaScript","相关Library"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrawcall%2Finkpaint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrawcall%2Finkpaint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrawcall%2Finkpaint/lists"}